Get Current CPT taxonomy category in shortcode
Get Current CPT taxonomy category in shortcode
Get Current CPT taxonomy category in shortcode
Modify shortcode to work with custom taxonomies and slugs
You have two big issues here are a few minor ones and some room for improvement. Lets look at your major mistakes first What you have done well is to add your output to a variable and then returning the variable in the end. Shortcodes should always return their output, not echo it. What you … Read more
Put this in your theme’s functions.php, it will add the shortcode [child_pages]: function wpsc_child_pages($atts){ global $wp_query; $html=””; if( empty($wp_query->post->post_parent) ) { $parent = $wp_query->post->ID; } else { $parent = $wp_query->post->post_parent; } $pages = wp_list_pages(“title_li=&child_of=$parent&echo=0”); if( $pages ){ $html .= “<div><ul>$pages</ul></div>”; } return $html; } add_shortcode(‘child_pages’, ‘wpsc_child_pages’); If you want to pass the function variables (e.g. … Read more
$return_string .= get_the_post_thumbnail(); should be: $return_string .= get_the_post_thumbnail( get_the_ID() );
Two issues here Never use extract(). It has been removed from core functions, that should tell you a lot. For more info, check this trac ticket #22400 Your tax_query is incorrect, it should be an array of an array, yours is just an array Your shortcode should look something like this function course_listings( $atts ) … Read more
Custom Login in Shortcode got error
Inserting a variable into a shortcode inside php
You can run the text through do_shortcode: echo do_shortcode( $your_text_with_shortcodes ); or you can apply the_content filters to the text, which does the same thing as above along with some additional formatting goodies, like auto paragraphs and texturize: echo apply_filters(‘the_content’, $your_text_with_shortcodes);
Is a plugin out of the question? Seems like that would be the exact solution to your problem.