Prioritise Pages over Taxonomy Term Root Archive, but not Taxonomy Term Child Archives
Prioritise Pages over Taxonomy Term Root Archive, but not Taxonomy Term Child Archives
Prioritise Pages over Taxonomy Term Root Archive, but not Taxonomy Term Child Archives
Is it possible to set archive.php instead of index.php to display blog?
Archive page of taxonomy returns a 404 error
The code you’re posting should work, as far as I can tell; however, you’re using some outdated template tags. Try replacing bloginfo( ‘url’ ) with echo home_url(), and bloginfo( ‘template_directory’ ) with echo get_template_directory_uri(), like so: <a href=”https://wordpress.stackexchange.com/questions/45310/<?php echo home_url(); ?>”> <img src=”<?php echo get_template_directory_uri(); ?>/images/logo.png” alt=”Good Morning Moon”/> </a> For more specific instruction, it … Read more
If you are simply registering a custom post type called ‘services” then your register code should look like register_post_type( ‘services’, $args ); Make sure the word “services” is exact in register_post_type. And Your post_type word should be max. 20 characters, can not contain capital letters or spaces Also make sure your has_archive parameter is set … Read more
Template hierarchy consist of templates, but not every template file is necessarily in hierarchy. Essentially hierarchy determines entry points (one of matching templates with pre-defined name structure), but from there template can further load additional arbitrary files. page-templates directory holds custom templates for pages (is_page() branch in hierarchy). It’s recent development that they can now … Read more
Page templates are special case and since WP 3.4 can be put in subfolder natively. Other than that WP mostly expects flat file structure for templates. While template hierarchy is easily adjusted (see dynamic filter in get_query_template(), pretty much only thing needed)… From personal experience – overly extensive and nested directory structure for templates makes … Read more
This is minimally tested– nearly untested really– but: function force_archive_php_wpse_88824() { if (is_main_query() && is_archive()) { include (get_stylesheet_directory().’/archive.php’); exit; } } add_action(‘template_redirect’,’force_archive_php_wpse_88824′); You are interrupting the template load process and forcing a file of your choice to be used. Reference http://codex.wordpress.org/Plugin_API/Action_Reference/template_redirect http://codex.wordpress.org/Function_Reference/get_stylesheet_directory
You can use it as a page template, just as any file with such a header can be used. That doesn’t necessarily mean it’s a good idea. The template hierarchy already uses index.php as a last resort if it cannot find an appropriate template for a page/post/listing etc, so a specific page will already have … Read more
Be sure to link that page in your functions page require_once(‘custom-register.php’) cp_head(__(‘Register’,’cp’)); ?> <?php cp_show_errors($errors); ?> <div class=”alert alert”><a class=”close” data-dismiss=”alert”>×</a><strong>Welcome: </strong> <?php _e(‘Complete the fields below to become a member.’, ‘cp’) ?> </div> <div class=”alert alert-info”><a class=”close” data-dismiss=”alert”>×</a><strong>Information: </strong> <?php _e(‘Your password will be mailed to you so use valid email address.’, ‘cp’) ?> … Read more