Unable to include a template
Unable to include a template
Unable to include a template
This code works, although I suspect that it could be more efficient – or replaced by a better filter. I modified this code from the answer to this question, which was the best choice out of all the googles I spent hours trying out.enter link description here You will need to change the ‘full’ to … Read more
Get templated page/post content via the WordPress API
Hm, likely if there are complete lists of options for “mood” and “location” than there could just be a script that generates all combination of them and – while generating – double check if there is actually enough content for them. And then put them in the sitemap that google uses for getting to know … Read more
How do you override Post template when using Query Loop block?
The easiest way to solve this is to create a special template file for previews, that will show the post twice in the different layouts. The following code will use the single-preview.php template file if it exists: add_filter( ‘single_template’, ‘wpse15770_single_template’ ); function wpse15770_single_template( $templates ) { if ( is_preview() ) { $templates = locate_template( array( … Read more
Simply use taxonomy-{taxonomy}.php. Refer to the Template Hierarchy Codex entry regarding taxonomies. WordPress will look for taxonomy template files in the following order: taxonomy-{taxonomy}-{term}.php – If the taxonomy were sometax, and taxonomy’s slug were someterm WordPress would look for taxonomy-sometax-someterm.php. taxonomy-{taxonomy}.php – If the taxonomy were sometax, WordPress would look for taxonomy-sometax.php taxonomy.php archive.php index.php … Read more
Just build it directly into your page.php template. e.g.: <?php global $post; if ( $post->post_parent ) { // This is a child Page; do something } ?>
just add <?php get_sidebar(); ?> to page.php in your child theme and all pages will have a sidebar. look at sidebar-page.php to see where to place it.
You’ve already got code to figure out which category you want to show posts from, here is how you would grab all the posts in that category: // create a query to grab our posts in category of ID $postcat $q = new WP_Query(array( ‘cat’ => $postcat)); if($q->have_posts()){ // foreach post found while($q->have_posts()){ $q->the_post(); // … Read more