Problem with custom page template and permalink
If you’re trying to set a custom homepage or custom blog page template, you should go to Settings > Reading and select the page you created that uses your custom page template:
If you’re trying to set a custom homepage or custom blog page template, you should go to Settings > Reading and select the page you created that uses your custom page template:
Simple:Press is what you are looking for. According to their Web site, they are “the number one forum plugin that integrates seamlessly into your WordPress website.” bbPress is another good one.
Use WP_Query class to do it: $the_query = new WP_Query( array( ‘post_parent’ => $post->ID, ‘post_type’ => ‘page’, ‘posts_per_page’ => 1, ) ); // The Loop while ( $the_query->have_posts() ) : $the_query->the_post(); ?> <h2 class=”subpagetitle”> <a href=”https://wordpress.stackexchange.com/questions/55118/<?php the_permalink(); ?>” rel=”bookmark” title=”<?php the_title(); ?>”> <?php the_title(); ?> </a> </h2> <?php endwhile; // Reset Post Data wp_reset_postdata();
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