Load template file without a post type

You could setup a custom rewrite rule using add_rewrite_rule and send these requests to a custom page. Your URL structure could be /index-page/single-event-slug The rule would point all of the single events to a separate page where you can then set your template events-single.php. Another option is to pass the events in as a query … Read more

Categories Template Assistance

Remove the cat parameter from your query and name your template file category.php From the WordPress Codex on Template Hierarchy; 1. category-{slug}.php – If the category’s slug were news, WordPress would look for category-news.php 2. category-{id}.php – If the category’s ID were 6, WordPress would look for category-6.php 3. category.php 4. archive.php 5. index.php The … Read more

Taxonomy landing pages

I can see at least 3 ways to do that. Adding a rewrite rule. See http://codex.wordpress.org/Rewrite_API for details: add_rewrite_rule(‘^(country|person|interest)/?’,’index.php?tax=$matches[1]’,’top’); then use the template_redirect filter to load your template when the taxvariable is there: if (get_query_var(‘tax’)) { # load the template here } You’ll also need to add the tax query var to the list of … Read more

Trying to manage templates on a blog with lots of custom taxonomies

Page templates can be stored within the page-templates or templates subdirectory within a theme, but this does not apply to custom post type or taxonomy templates. Fortunately, the template_include filter can be used to change the template that will be loaded. In the example below, template files are stored in the /theme-name/templates/ directory. /** * … Read more

WooCommerce Template overriding not working with woocommerce.php

It’s a custom theme, so first of all you should check if WooCommerce support is declared in the functions.php. WooCommerce can be integrated with the theme by using woocommerce_content() (woocommerce.php file) or by template overrides, but in both cases the declaration of support in the theme is required. function wpse319485_add_woocommerce_support() { add_theme_support( ‘woocommerce’ ); } … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)