global variables in templates
Define it in functions.php, which is loaded on every request. However, there are far better options than a global variable: a function a template part if it’s a template you’re defining filters
Define it in functions.php, which is loaded on every request. However, there are far better options than a global variable: a function a template part if it’s a template you’re defining filters
You do not need to explicitly call the post-single template, this is something wordpress is doing automagically for you based on the URL structure. For archive URLs the archive template will be “called” while for single posts the single template will be “called. There are fullbacks with the ultimate one is the index.php template. For … Read more
You can try this plugin, I think this will work for you. You can directly change the URL on your page by clicking on URL to whatever you want. Hope this would be helpfull.
First of all, (you probably know this but..) you are fighting how WP is intended to work. You can not get the post ID directly in your custom page template because it is not displaying the post. So you will have to, as you said, send the post ID to the page template. The best … Read more
If you’ll take a look at next_post_link Codex page, you’ll see it’s usage: <?php next_post_link( $format, $link, $in_same_term = false, $excluded_terms=””, $taxonomy = ‘category’ ); As you can see, third param is in_same_term and it’s default value is false. If you set it to true, then the function will return next post from same category. … Read more
Single template showing all posts of that type
how to get the categories for a single product in a hierarchical way
Remove post templates from the selection box menu when creating a single post
Although I have not tested a use case such as yours. If the trouble is with path to the images in the posts and other you can give WordPress OneClick Migration a try. It was designed with Database level migration but it should work. You may need to run it in forced mood. See the … Read more
After some more Googling… New single.php looks like this: <?php get_header(); global $wp_query; if ( ! isset( $wp_query->query_vars[‘map’] ) ) { if (have_posts()) : while (have_posts()) : the_post(); the_title(); the_content(); endwhile; endif; ?> <p><a href=”https://wordpress.stackexchange.com/questions/31442/<?php echo get_permalink(); ?>?map=yes”>Map</a></p> <?php } else { ?> <div id=”map-canvas”></div> <?php } get_footer(); And functions.php like this: add_filter(‘query_vars’, ‘parameter_queryvars’ ); … Read more