Changing a function in function.php to a shortcode – for listing categories of only a certain post type

It looks like wp_list_categories($args) will output directly when you call it, which is why the output comes out in a weird place. and ideally what you need is to capture the output and return it, but luckily wp_list_categories allows you to do this with the ‘echo’ parameter. Try: $args[‘echo’] = FALSE; return wp_list_categories($args); Note the … Read more

TinyMCE popup windows using WP functions

The popup of a TinyMCE is outside WordPress. You must include the wp-load.php, same handle like outside the WordPress install. But think about this solution and maybe it is cleaner, that you create your data in a json string and handle this data in the popup. It is helpful to reads this post about the … Read more

Gallery Settings Change available Columns

Short answer Simple as things sometimes are: No this is not possible. The whole part is hard coded. Long answer (not recommended to do so) You could maybe jump into the esc_html and attribute_escape filters and just return empty there *), but as those are pretty generic names and would possibly also interfere with other … Read more

Execute shortcode within shortcode

I haven’t tried this, but you could try pseudo-changing the priority of your shortcode hook. Basically, you force your shortcode to execute before it would normally. That link shows how to execute your shortcode separately – and, more importantly, before – the other shortcodes get implemented. This works by caching and temporarily removing all existing … Read more

using 1 form shortcode (si or cf7) for all multisite sites [closed]

A Must Use plugin could do the work. This is just an outline and has to be fully tested: add_shortcode( ‘global_form’, ‘shortcode_wpse_87634’ ); function shortcode_wpse_87634() { // Main site, ID=1, that has the form switch_to_blog( 1 ); // Do your stuff $my_stuff = something(); // maybe do_shortcode // Back to original site restore_current_blog(); // Return … Read more

How can I run shortcode after click with ajax

You should try to replace the following jQuery part: action: ‘process_shortcode_on_tab_click’ with this one: action: ‘process_shortcode_on_tab_click_action’ to match your wp_ajax_process_shortcode_on_tab_click_action and wp_ajax_nopriv_process_shortcode_on_tab_click_action actions. Check for example the Codex on how to name the custom wp_ajax_$youraction hook.

Insert Images at Master Uniform Height

There are multiple solutions: Use CSS for post images: .post img { height: 300px; width: auto; } Use a custom thumbnail size. Either in Settings -> Media or use a third-party plugin to generate them. Another way would be to code your own: function custom_image_sizes() { add_theme_support(‘post-thumbnails’); add_image_size(‘breaking-news’, 9999, 300, true); } function add_custom_sizes( $imageSizes … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)