Problem with permalink structure for WordPress custom post_type archive template
you can use rewrite parameter in register_post_type ‘rewrite’ => array(‘slug’ => ‘product’,’with_front’ => FALSE) and change the permalink structure to postname.
you can use rewrite parameter in register_post_type ‘rewrite’ => array(‘slug’ => ‘product’,’with_front’ => FALSE) and change the permalink structure to postname.
I’m not sure if it can be done with posts, but if you’re using pages, you can use a template called page-id.php where id is the page id of your track car page. The template hierarchy can help you.
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 🙂
I was able to find a solution to my own problem. For anyone needing to solve this in the future, WordPress offers a set of conditional statements for just able everything, include pagination. <?php get_header(); ?> <?php if ( ! $paged || $paged < 2 ){ ?> <?php locate_template( ‘featured-post.php’, true, false ); ?> <?php … Read more
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
One post cannot (and should not) have two single post URLs. All you can change is the archive view, the list of posts. If /gallery/ and /extra/ are post of the post type page, use a custom page template for those. Update Create two endpoints gallery and extra for the root (EP_ROOT) (another example). The … Read more
One can do that by copying imagebrowser.php from /wp-content/plugins/nextgen-gallery/view/ to yourthemedirectory/nggallery.php If you want to customise other templates, you can do the same too. Some more information can also be found here.
http://codex.wordpress.org/Function_Reference/next_post_link#Text_As_Link.2C_Without_Post_Title.2C_Within_Same_Category in same category = true is the trick