Page template is accessing the incorrect posts?
You pull content normally. You don’t have to specify any id, as page/post will use template it is assigned to, so I don’t really understand your question.
You pull content normally. You don’t have to specify any id, as page/post will use template it is assigned to, so I don’t really understand your question.
If you’re on the same page and you just need to display the same page’s content again, you can just call the_content multiple times. To answer your question, however: You’ll use the page_id argument for WP_Query (you could also probably use p). You can even remove your global $wp_query and the like. <?php $new_query = … Read more
The template naming is a bit confusing in this situation, but what is happening is normal behavior in the Template Hierarchy. home.php shows your posts page, whether it’s on the front page, or assigned to another page when using a static front page. If you want your home.php template to be used for your static … Read more
Without knowing your theme, you have at least a few options. You could 1. hide it with CSS. .your-page-template-php #your-menu { display: none; } Or 2. you could create a custom header file. For example, duplicated header.php to header-nomenu.php. And in your new file delete the menu. And then in your page template instead of … Read more
There are two issues here: The use of query_posts() Undefined $pagename variable I assume that you want to use the page slug as the string passed for the category parameter in the query arguments array? You can get that via $post->post_name, like so: global $post; $page_slug = $post->post_name; Then, to pass that as a query … Read more
Instead of calling get_sidebar() call get_sidebar( ‘somethingelse’ );. It will attempt to load sidebar-somethingelse.php and if that doesn’t exist it will load sidebar.php. You can then modify the sidebar-somethingelse.php to load a different sidebar etc I strongly recommend you look up how the template hierarchy works.
i putting something else in action? Yes. The complete path to the file. If your site is http://mysite.com and you are on the home page then you are requesting a file at http://mysite.com/result.php. If you are on a date archive you’d be requesting a file at http://mysite.com/2013/03/03/result.php. The file you want is actually at http://mysite.com/wp-content/themes/theme-name/result.php. … Read more
Your main problem is that when you list your events, you (most probably) use the the_permalink() function to get the url of the single event. When this url is called, WordPress show the single event, but how can WordPress know if the link was clicked in the page-events.php or in the page-media.php? If you don’t … Read more
Not including header.php and footer.php is a bad idea, as they usually contain the calls to wp_head() and wp_footer(), which are required by Plugins and Theme functionality (of course depending on what you do on your site). The second thing is that you create invalid HTML. Depending on your needs there are a variety of … Read more
Content in a page can come there in four ways in WordPress: In-page Content: That’s coming from the WordPress’ site’s page content itself. In this case you have to edit the page in your /wp-admin. Page Template: That’s coming from a page template. In this case, you have to get into your theme folder to … Read more