Unique design inside a specific category’s url

There is a filter called theme_page_templates which you can use to force the use of a certain template under certain circumstances. Like this: add_filter (‘theme_page_templates’, ‘wpse263827_filter_theme_page_templates’, 20, 3 ); wpse263827_filter_theme_page_templates ($page_templates, $this, $post) { if (condition based on $post) $page_templates=”path-to-template.php”; return $page_templates; } So, you can place the template file wherever you want and assign … Read more

Replace site title with logo when logo is uploaded in customizer using

Solved: <div class=”site-branding”> <?php $logo_id = get_theme_mod( ‘custom_logo’ ); $logo_image = wp_get_attachment_image_src( $logo_id, ‘full’ ); if ( ! empty( $logo_image ) ) : ?> <span class=”site-logo”><a href=”https://wordpress.stackexchange.com/questions/265299/<?php echo esc_url( home_url(“https://wordpress.stackexchange.com/” ) ); ?>” rel=”home”><img src=”<?php echo esc_url( $logo_image[0] ); ?>” alt=”<?php bloginfo( ‘name’ ); ?>”/></a></span> <?php else : ?> <h1 class=”site-title”><a href=”https://wordpress.stackexchange.com/questions/265299/<?php echo esc_url( home_url(“https://wordpress.stackexchange.com/” … Read more

Show About and Contact Us page when they’re clicked in the top menu.

You need to include a loop to retrieve the page content. Something like: <div id=”primary” class=”site-content”> <div id=”content” role=”main”> //BELOW HERE <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( ‘content’, ‘page’ ); ?> <?php comments_template( ”, true ); ?> <?php endwhile; // end of the loop. ?> //ABOVE HERE </div><!– #content –> </div><!– … Read more

How to show the number of website visitors in my theme

Here is what you need to use for the expected result: <p> Today’s Views: <span> <?php echo wp_statistics_visit(‘today’); ?> </span></p><br><br> <p>Yesterday’s Views: <span> <?php echo wp_statistics_visit(‘yesterday’); ?> </span></p><br><br> <p>All times Views: <span> <?php echo wp_statistics_visit(‘total’); ?> </span></p><br><br>

Search form does not work in my website

You’re missing the name of the search text input, so replace: name=”” with name=”s” Then take a look at searchform.php in the default themes, like Twenty Sixteen: <form role=”search” method=”get” class=”search-form” action=”<?php echo esc_url( home_url( “https://wordpress.stackexchange.com/” ) ); ?>”> <label> <span class=”screen-reader-text”><?php echo _x( ‘Search for:’, ‘label’, ‘twentysixteen’ ); ?></span> <input type=”search” class=”search-field” placeholder=”<?php echo … Read more

Set a featured image as a replacement to the header image

You did not mention or shown in the code to which hook are you hooking the above code to, but here’s what I think should work. NOT TESTED global $post; $header_image=””; // featured image is first priority, right? if ( has_post_thumbnail( $post->ID ) ) { $header_image = get_the_post_thumbnail_url( $post->ID, ‘full’ ); } elseif ( !empty( … Read more