Inserting javascript file into theme template?
If you have access to the server you can create the file there (inside the theme folder) and edit it from the theme editor.
If you have access to the server you can create the file there (inside the theme folder) and edit it from the theme editor.
Validating Error with submit button
Thinking about this problem some more, and meditating on the WordPress template hierarchy below, I came up with a solution to my own problem. I found that if I looked at the left side of the template hierarchy diagram and found the page type I was interested in, I could then work my way as … Read more
The template isn’t determined by the URL, it’s taxonom-{taxonomy_slug}.php See here for the full template hierarchy: https://developer.wordpress.org/themes/basics/template-hierarchy/ And a visual representation: https://wphierarchy.com/ Final Note on Terminology There’s a difference between taxonomies and terms, and muddling the two words or always referring to them as taxonomies will get confusing very quickly. For example ‘accounts’ would be … Read more
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
At the end, i solved it. To use php files as partials for angularjs routes, i had to include the file wp_load.php on them. In code, on top of each partial: <?php include_once(‘wp_load.php’); ?> And i can now use wp functions wherever i want. Keep in mind that you need relative path, so you should … Read more
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
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
Because the Blog Page isn’t an Page for WordPress, but a Listing, and Takes the “index.php” if there is no “home.php”. How to Solve: create a home.php and Insert the code, that you need in there.
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