How to use extract shortcode in loop?
Have you tried echo do_shortcode(‘[your_shortcode attribute1=”value” attribute2=”another”]’); this should fire the shortcode function in PHP
Have you tried echo do_shortcode(‘[your_shortcode attribute1=”value” attribute2=”another”]’); this should fire the shortcode function in PHP
Something went wrong with your migration. A plugin– I think it is this one— does not have the table(s) it needs to operate. I assume that some tables were not transfered. Disable that plugin, then reactivate it and this should clear up. I assume that the plugin will create its tables on re-activation. If you … Read more
echo get_permalink(123); instead of the_permalink(), provided you know the ID of the “specific page”. the_permalink() will always link to the current post in the Loop, and somewhat nonsensically does not take an ID parameter the way that get_permalink() does. Reference: https://codex.wordpress.org/Function_Reference/get_permalink
You can make use of dynamic hook do_action( “{$old_status}_to_{$new_status}”, $post ); in wp_transition_post_status() to target exact combination. So in your case it would be something like draft_to_publish. I am not sure why exactly your attempt is failing though, without thoroughly debugging it.
Thanks for the help again 🙂 Love this place! The issues was on the single.php page. I have this if statement: <?php $post = $wp_query->post; if ( in_category(‘latest-news’) ) { include(TEMPLATEPATH . ‘/single-latest-news.php’); } elseif ( in_category(‘latest-sermons’) ) { include(TEMPLATEPATH . ‘/single-latest-sermons.php’); } elseif ( in_category(‘sunday-service’) ) { include(TEMPLATEPATH . ‘/single-sunday-service.php’); } elseif ( in_category(‘events’) … Read more
Your code has a lot of errors. For example, inside you should define the global $current_user, not outside. Other error, you use $query_vals variable outside the function where that variable is not defined. Anyway, I would use the function wp_get_current_user() which have not to be called before init action hook. For example, if you are … Read more
I personally like to take all the categories a post is attached to and slap an active class onto them. Here’s the code I found and currently use. /** Active Category **/ // Single Posts only function singlePostActiveCat ($CatText) { global $post; if (is_singular()) { $categories = wp_get_post_categories($post->ID); foreach ($categories as $category_id) { $category = … Read more
get_post_field alone does not render shortcodes. Try echo do_shortcode( get_post_field( ‘post_content’, $post->ID) );
Allow users to create their own page/s
404 error on every post and page other than home