plugin overwrites other plugin’s archive-.php file

A core contributor had mercy with me – and an answer: $post_type = get_post_type(‘tires’) is not the correct method to get the post type in a reliable way. Instead, you need to use is_post_type_archive(‘tires’) The correct function looks like this: // Template Logic function rg_wp_tires_template_logic($original_template) { if(is_post_type_archive(‘tires’) || (is_search() && $_GET[‘post_type’] === ‘tires’)) { if(file_exists(get_template_directory_uri() … Read more

How to serve a amp template

I think you need to have another look at the AMP documentation. You simply have to include the link to the AMP version of the article in the header of the post. <link rel=”amphtml” href=”http://www.example.com/post-slug/?amp” /> After Google recognizes your posts have AMP versions it will automatically serve the AMP version for you. Also, this … Read more

Main content not displaying using custom page template

First you need to show the content <?php the_content() ?> Then you need to add containers for the sidebar and content <div class=”main-content ten columns”> <?php the_content() ?> </div> <div class=”side-bar two columns”> <?php if ( is_active_sidebar( ‘wizard-sidebar’ ) ) : ?> <?php dynamic_sidebar( ‘wizard-sidebar’ ); ?> <?php endif; ?> </div> The theme already has … Read more

Nested Page Template not showing in page attributes

In WP 3.4 they allowed adding template files one level deep. Since then code has changed, however in wp-includes/class-wp-theme.php, in offsetGet() (from __get()) you’ll see: case ‘Template Files’ : $files = $this->get_files( ‘php’, 1 ); Although I can’t fully unravel the maze of code for loading a theme, the above suggests the second argument, $depth, … Read more

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