Use another theme template in my theme
Create child theme of the main theme you’re using. That way you can override just the parts you want. Reference – https://codex.wordpress.org/Child_Themes Hope it helps!
Create child theme of the main theme you’re using. That way you can override just the parts you want. Reference – https://codex.wordpress.org/Child_Themes Hope it helps!
For those interested, i’ve solved my problem using sizeof($wp-query->posts) The end-result is this content-news.php template <?php //echo sizeof($wp_query->posts); //var_dump($wp_query);die(); if(sizeof($wp_query->posts) == 4) : ?> <?php if( $wp_query->current_post == 0 ) : ?> <h3><?php the_title(); ?></h3> <div class=”row”> <div class=”col-md-12″> <p><?php the_excerpt(); ?></p> <p><a href=”https://wordpress.stackexchange.com/questions/216989/<?php the_permalink(); ?>” class=”btn btn-primary btn-sm”>Lees Meer</a></p> </div> </div> <div class=”fh5co-spacer fh5co-spacer-sm”></div> … Read more
the last $file takes priority over the previous That’s because you assign the new value to the $file variable at every line. The only way I see you can do it by using the array: <?php // define directory list $directories = array( ‘home’, ‘pages’, ‘blog’, ‘single-posts’, ‘products’, ‘templates’, ‘products’ ); // run through directories … Read more
Display different list of “Custom Templates” for each Custom Page Type
Rewrite single template permalink?
You can use below code. get_the_client(get_the_ID()); get_the_company(get_the_ID()); get_the_website(get_the_ID());
Try… function maybe_auth_redirect() { if ( is_page_template(‘my-template.php’) && ! is_user_logged_in() ) { auth_redirect(); } } add_action(‘template_redirect’, ‘maybe_auth_redirect’); https://developer.wordpress.org/reference/functions/is_page_template
So, it looks like I didn’t understand how a custom taxonomy works. http://joshrodg.com/hallmark/letters/tags/moore/ should be http://joshrodg.com/hallmark/tags/moore/ and http://joshrodg.com/hallmark/letters/tags/kenya/ should be http://joshrodg.com/hallmark/tags/kenya/. My mistake was that I expected the tags to be linked off my custom post type url, and not my main domain. I found the answer here: Archive template for taxonomy terms Thanks, Josh
They do not differ technically. These files exist in your theme directory and the template that loads is determined by the following: If you have a product with slug of dmc-12, then WordPress will first look for a file called single-product-dmc-12.php in the theme directory. If it finds it it will use that template when … Read more
Assuming post type is my-post-type. We can create a page template with custom query using WP_Query. Let’s say we create template-multier.php with the below code in the root directory of the active theme. <?php /* Template Name: Custom Post Type Archive */ //Custom header stuff here //Custom query for `my-post-type` $args = array( ‘post_type’ => … Read more