How to wrap a text with shortcode into php file?

You can use the load_value ACF filter: function wpse0605_acf_load_field( $field ) { $field = ‘[box]’ . $field . ‘[/box]’; return $field; } // acf/load_field/name={$field_name} – filter for a specific field based on its name add_filter(‘acf/load_value/name=diorganwths_diagwnismou’, ‘wpse0605_acf_load_field’); add_filter(‘acf/load_value/name=apaitei_logariasmo_facebook’, ‘wpse0605_acf_load_field’); The code can go into the theme’s functions.php, or inside a plugin constructor.

How to change links in the 3 main categories, on widget category, to a javascript function call

The Answer is: $(document).ready(function() { $(“#f-submenu”).hide(); $(“#m-submenu”).hide(); $(“#i-submenu”).hide(); $(“.widget ul li > a:not(ul li ul li>a, ul li+li ul li>a,ul li+li+li ul li>a )”).attr(“href”, “javascript:hideMenu();showSubMenu(‘m-submenu’)”); $(“.widget ul li+li > a:not(ul li ul li>a, ul li+li ul li>a,ul li+li+li ul li>a )”).attr(“href”, “javascript:hideMenu();showSubMenu(‘f-submenu’);”); $(“.widget ul li+li+li > a:not(ul li ul li>a, ul li+li ul li>a,ul li+li+li … Read more

How to Publish WP original Source metabox value on front-end webpage

get_post_meta is returning an array. Apparently, the plugin is saving _original_source as an array. I don’t know what that array looks like but instead of echo do print_r($original_source); and you get something that looks like: Array ( [a] => apple [b] => banana ) You can then do something like echo $original_source[‘a’] to print “apple”.

Looping taxonomy in taxonomy?

In case anyone runs into trouble like I did, I figured it out! $taxonomy_1 = get_terms( ‘taxonomy_1’, $args_1 ); $taxonomy_2 = get_terms( ‘taxonomy_2’, $args_2 ); foreach( $taxonomy_1 as $tax_1 ) { foreach( $taxonomy_2 as $tax_2 ) { $posts = get_posts( array( ‘posts_per_page’ => -1, ‘post_type’ => ‘ENTER-YOUR-CPT’, ‘order’ => ‘ASC’, ‘orderby’ => ‘title’, ‘taxonomy’ => … Read more

Photos do not show on SEO platform built into a wordpress plugin

Your question makes it seem like you are using relative URLs– “I used the path for the images like this: images/image.jpg …” Don’t use relative URLs in WordPress. Relative paths are not reliable, except in stylesheets. They do work in stylesheets. Use functions like admin_url and these other related functions.

Enforce conditions only for draft posts using WyPiekacz, ignore pending and published posts

The check is invoked after a call to get_option( ‘wypiekacz_allow_skip_rules’ ). When you filter pre_option_wypiekacz_allow_skip_rules and returns something different than FALSE, it should stop the check early. Not tested. add_filter( ‘pre_option_wypiekacz_allow_skip_rules’, ‘wpse_100503_wypiekacz_for_drafts_only’ ); function wpse_100503_wypiekacz_for_drafts_only( $bool ) { if ( ‘draft’ === get_post_status( $GLOBALS[‘post’] ) ) return $bool; return 0; } To prevent the post … Read more

Snapshot Theme from WooThemes — empty ‘alt’ attribute

Since the original theme demo image doesn’t have any value in alt, I’m assuming there is a bug in the theme you might need to open a ticket for: http://demo.woothemes.com/snapshot/ I don’t recommend altering original theme template functions but if you are very far into the project and rather not switch out to another theme, … Read more

why is markup routinely placed in functions in wordpress?

I think WordPress is one of the cases where the original code just got bigger and bigger without having a chance to be rewritten from ground up with best practices. In this case, I think the WordPress conventional practice (writing markup in function) outweigh the best practices. You might find the theme development documentation interesting … Read more