Create Short code dynamically

I cannot comment, I would if I could, but I can’t, please don’t down-vote Could you not just use 1 shortcode with a parameter, e.g. instead of create one for each gallery image-gallery-1,image-gallery-2 etc, you could just use the ID as a parameter: image-gallery 1, image-gallery 2 … Then in your handling function you can … Read more

Best practice when modifying plugins CSS [duplicate]

Any changes you make to the plugin’s stylesheet will be overwritten when you update the plugin. Likewise with an edit to the theme’s stylesheet. Even if you create your own stylesheet and enqueue it via functions.php you will have redo the enqueueing when you update. Of course, if this is a theme (or child theme) … Read more

WP_Table_List and ob_start() memory limit

How often do the results change? I think the results are finally and did not change often (or never). Maybe it is better to use a file caching then using output buffering. Write the results to a file and append a hash or date to the filename as indicator. If the results are updated or … Read more

How can I temporarily remove content from all pages, but leave up URL?

Depends on what you mean by “content”. If you just want to remove the post body then… function remove_body_wpse_97291($content) { return “Content temporarily removed”; } add_filter(‘the_content’,’remove_body_wpse_97291′,100); If you want more aggressive content removal… function remove_all_content_wpse_97291($content) { include(‘license.txt’); // example loads the WordPress license agreement as raw text; not pretty exit; } add_filter(‘template_redirect’,’remove_all_content_wpse_97291′,1); The URLs stay … Read more

Woocommerce: Set thumbnail detail (clipping area)

You can fix this using the following code snippet from Brian Krogsard, that I modified. This code should preferably be placed into the functions.php file of your child theme. Instead of taking the original 150×150 thumb it now takes the correct, cropped 150×150 thumb. /* This snippet removes the action that inserts thumbnails to products … Read more

Order posts of a custom post type by the event date using FT Calendar Plugin

My guess is that the calendar date is some sort of meta field for the custom post type. I’d find that out and add that as a variable for my query. You might be able to use something like this <?php $loop = new WP_Query( array( ‘post_type’ => ‘events’, ‘meta_key’=>’start_datetime’, ‘orderby’ => ‘meta_value’, ‘order’ => … Read more