Video Background – (php & css) – generating 404 error on page load – WordPress Theme File Structure Help
Your paths should be: /wp-content/themes/gt3-wp-pure/page-templates/ … instead of: public_html/wp-content/themes/gt3-wp-pure/page-templates/
Your paths should be: /wp-content/themes/gt3-wp-pure/page-templates/ … instead of: public_html/wp-content/themes/gt3-wp-pure/page-templates/
When you perform a custom query such as this one, you have to do a bit of a “hack” to get pagination to work properly. Change this: <?php query_posts( “category_name=news&orderby=date&order=ASC&posts_per_page=2” ); ?> …to a WP_Query call: <?php $news_query = new WP_Query( “category_name=news&orderby=date&order=ASC&posts_per_page=2” ); ?> And then you need to *move your custom query object into … Read more
if you’re using a page template, then if you want to get the current page URL you could try to use this function: get_permalink(); or echo get_permalink(); if you want to print the result
Put the template file in your theme and add the following comment to the top of your file after the /** * Template Name: This is the name of your template */ WordPress will pick this up and in the page templates dropdown you will see “This is the name of your template” listed as … Read more
I think I have a workable solution on what I was trying to do. This works but is there a better way? Also are there any implications I should be aware of when using $_GET? Didn’t realize it would be this easy 🙂 perhaps I’m missing something. <?php $view = $_GET[“view”]; ?> Then if the … Read more
In regard to WordPress post paged, I would use /player-12345 or other structure as url specific page rather than /player/12345. How to create new url structure for page Creating additional url structure, you need WP_Rewrite, there are a couple of filters that you can fire with your function. For Page, you can filter page_rewrite_rules. See … Read more
The »Template Hierarchy« doesn’t allow this per default. Inside your single.php template, you can call load_template(). This will allow you to simply include the template you need, based on the in_category() conditional tag. // inside single.php if ( in_category( ‘foo’ ) ) { load_template( get_stylesheet_directory().’foo_template.php’ ); } elseif ( in_category( ‘bar’ ) ) { load_template( … Read more
You can certainly use Page Templates for that. They’re a specific type of template file that can be applied to a specific page or groups of pages. Plus, they can be stored in sub folders. All you need is to put something like this at the top of the template files: /** * Template Name: … Read more
Index.php isn’t for a specific page, and that’s not how template files in themes work. You will need to understand the template heirarchy http://codex.wordpress.org/Template_Hierarchy WordPress uses the Query String — information contained within each link on your web site — to decide which template or set of templates will be used to display the page. … Read more
Paste following code to your theme’s functions.php: add_action(‘save_post’,’changeTemplateOnSave’); function changeTemplateOnSave(){ global $post; $curr_tmp = get_post_meta($post->ID, ‘_wp_page_template’, true); $parent_tmp = get_post_meta($post->post_parent, ‘_wp_page_template’, true); if($post->post_parent) update_post_meta($post->ID,’_wp_page_template’,$parent_tmp,$curr_tmp); } This will force WordPress to change page template to it’s parent template on post save. Not tested but should work.