Brian
  • Member for 11 years
  • Last seen more than a month ago
Programmatically add a Navigation menu and menu items
16 votes

I have a few issues with the accepted answer - that doesn't make it wrong, but I'll post my own code below which I feel might have a better result for some people since I had the same question but ...

View answer
WPML Plugin Not displaying multilingual Menus
Accepted answer
5 votes

I ended up having to manually detect the language, here's how I solved it: <?php if (ICL_LANGUAGE_CODE == 'fr') { // display the menu en francais wp_nav_menu( array( ...

View answer
Specific upload folder for PDFs in custom Post type in WP multisite
2 votes

The reason you're having trouble here is that you're applying a universal filter to upload_dir. Rather than doing this, use a conditional filter for upload_dir after first checking ['mime-type'] for ...

View answer
Responsive Images - Generating multiple images from Theme Customizer control upload?
Accepted answer
2 votes

If someone has a better solution, I'm open to it, however, what I came up with seems to work fine. Basically the following code is just waiting for the image to finish uploading and then hooking ...

View answer
get_pagination not working on a custom post type query (using WP_Query)
Accepted answer
2 votes

Pagination is only built "well" in non-custom post-types. Below, I'll post an article with more detail about the more complex setup required for custom post-type pagination via the WP_Query() method....

View answer
Subdomain is not working
1 votes

After setting define('WP_ALLOW_MULTISITE', true); in your wp-config.php file and doing "Network Activate", you need to copy some new constants to your wp-config.php file. Are the following constants ...

View answer
Customizer: Unique identifier that distinguishes which image upload control is uploading an image
Accepted answer
1 votes

Thanks to the tipoff from @birgire in the comment, I was able to locate two things, an example of an implementation that includes context, here (also of note is that the Github gist has code for the ...

View answer
Update Specific Key Value in Complex `wp_options` object
1 votes

Sorry for being dense, you need to grab the object, overwrite the key you want to set and then save the updated object as the new option: $my_plugin_settings = get_option('my_plugin_settings'); $...

View answer
Show comment number per author per day
1 votes

Yes it's definitely possible. Refer to http://codex.wordpress.org/Function_Reference/get_comment, you'll need to get the current server time in UNIX format and then convert comment_date_gmt from each ...

View answer
Active Plugins for current blog in WP Multisite Network?
0 votes

Looks like get_option('active_plugins) does the trick. Also, this question has already been answered here, sorry for the duplicate: How to Check If A Plugin Is Enabled Through API?

View answer