How to detect if some page template has been selected
sure it is possible. Just check the page meta field (assuming you’re in the loop): $template = get_post_meta( get_the_ID(), ‘_wp_page_template’, true );
sure it is possible. Just check the page meta field (assuming you’re in the loop): $template = get_post_meta( get_the_ID(), ‘_wp_page_template’, true );
Thank you guys for quick response. Here is the code that worked for me. <?php if( is_home() != ” && !is_paged()) { ?> div here <?php } ?>
Check your code, Maybe you have entered post url code with content I mean like.(URL code) (Content Code) I have checked your concern and i found these solutions. If still facing problem then paste here your code so i can understand that.
Thanks to Milo’s comment I could find a solution. In my home.php I have deleted the custom query and inserted: <div class=”news-content col-12 col-xl-8″> <div class=”row”> <h1>News</h1> </div><!– .row –> <div class=”row”> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); if(has_post_thumbnail()) :?> <div class=”news-wrapper col-12 col-xl-6″> <div class=”news-date”> <?php the_time(‘j.m.Y’); ?> … Read more
Function/way to redirect to specific page whenever a specific text occurs on homepage?
I use this code and now it works. I think using wp-head instead of init was important in the add_action parameter: function remove_sf_header_widget_region() { if(!is_front_page()){ remove_action( ‘sf_before_content’, ‘sf_header_widget_region’, 10 ); } } add_action( ‘wp_head’, ‘remove_sf_header_widget_region’ );
homepage not fully loading after loutout
You’re nearly there, all that is left is to check on which page you currently are. In the following code I’m first creating an array where the key corresponds to the page number and the value are the categories to exclude. This results in only one time writing $query->set(…. And to be really sure that … Read more
Delete you .htaccess file in root Reset your permalink structure If have access to the theme file make sure your blog title link refers to the_permalink() as destination. you might have open anchor tag from the logo which developer forgot to close.See page source or inspect it. Share the code in your loop.
There are many ways to do this, but one way would be to use Page Templates. You can then select the template in the editor for each page.