Shortcode or Template Page

Actually it depends. If you’re adding the functionality through a custom plugin or any third party solution rather than theme then the shortcode is best, otherwise you can use a template. You also can use template file with plugin, but then the theme and the plugin will be tightly coupled. That’s kinda not preferred. But … Read more

How to make a custom search template for custom taxonomy?

I added this code before my loop and separated the custom taxonomy templates rather than pointing them to one general search template to display results based on the current taxonomy. Hope this helps someone. $current_cat = get_query_var(‘model’); $args = array( ‘post_type’ => ‘truck’, ‘model’ => $current_cat ); query_posts($args);

How can I modify this code to include the parent?

There are many way to do that and WordPress has some default functions to get that parent page. In fact there is a thing called post_parent in post object. However, you can use the below techniques I think- get_post_ancestors( $post ) function. Here $post is ID or object. Here you’ll find the documentation. You can … Read more