WordPress Template works until page becomes a child
Disregard, I found the problem. I needed to refresh the .htaccess file by going to Settings->Permalinks and hitting Save Changes.
Disregard, I found the problem. I needed to refresh the .htaccess file by going to Settings->Permalinks and hitting Save Changes.
Here is another similar thread that have been resolved now.. Get name of the current template file Take a look..
you can use rewrite parameter in register_post_type ‘rewrite’ => array(‘slug’ => ‘product’,’with_front’ => FALSE) and change the permalink structure to postname.
This may be what your looking for: ` <div class=”blog-post”> <?php static $count = 0; if ($count == “4”) { break; } else { ?> <h2><a href=”https://wordpress.stackexchange.com/questions/62131/<?php the_permalink() ?>”><?php the_title(); ?></a></h2> <ul class=”meta”> <li><?php the_time(get_option(‘date_format’)); ?></li> <li>| </li> <li><span>Posted By</span> <?php the_author_posts_link(); ?></li> <li>| </li> <li><a href=”#”><?php comments_number(‘No comments yet’,’1 comment’,’% comments’)?></a></li> </ul><!–end of meta–> … Read more
When changing the setting to make the front page a static page, you will have assigned the blog posts to another page. If you name that page ‘blog’ you can access your latest posts at yourwebsite.com/blog No extra tinkering required 🙂
Ok, but I was afraid it’s not really a good solution. Works, though. First, I rewrote the query in order to get pretty permalinks: /*Añadido: Reescribir URL query: “?pa_dispositivo=nombre&pa_marca=nombre”*/ function custom_rewrite( $wp_rewrite ) { $feed_rules = array( ‘tipo/(.+)/marca/(.+)’ => ‘index.php?pa_dispositivo=’. $wp_rewrite->preg_index(1).’&pa_marca=”. $wp_rewrite->preg_index(2) //”(.+)’ => ‘index.php?pa_marca=”. $wp_rewrite->preg_index(1) //”(.+)’ => ‘index.php?pa_dispositivo=’. $wp_rewrite->preg_index(1) ); $wp_rewrite->rules = $feed_rules + … Read more
There’s the core function add_*/get_query_arg() that you can use to append stuff to the query and retrieve it. So simply add a link somewhere, that points to your custom post types single.php template single-{$custom_post_type}.php Then append the query arg which would be ?wpse_meta_key=wpse_some_val and then do a switch on top of your template: if ( … Read more
Ok so I sorted the issue for now by using – $queried_object = get_queried_object(); $term_id = $queried_object->term_id; instead of – $tags = wp_get_post_tags($post->ID); $first_tag = $tags[0]->term_id; Any comments?
When checking each template include, the single footer contained an error. To resolve this, i duplicated the code from the index footer and amended for the single template. Thank you for your replies.
I think this is what you’re looking for: http://codex.wordpress.org/images/1/18/Template_Hierarchy.png