If I understood you correctly:
<?php
//if home, do nothing
if( ! is_home() || ! front_page() ) {
//if has post thumbnail
if( has_post_thumbnail() ) {
the_post_thumbnail( 'full' );
echo '<h1 class="entry-title">'. get_the_title() .'</h1>';
} else {
//no post thumbnail, show normal entry title
echo '<h1 class="entry-title">'. get_the_title() .'</h1>';
}
}
or, it can be done easily:
<?php
if( ! is_home() || ! is_front_page() ) {
if( has_post_thumbnail() )
the_post_thumbnail( 'full' );
echo '<h1 class="entry-title">'. get_the_title() .'</h1>';
}
Related Posts:
- wp_enqueue_script adding conditional statement not working
- Check if first paragraph is an image, then show custom code right after it?
- If post author role is X
- Can a conditional statement apply to part of a slug?
- Add default content to posts in a specific category?
- is_front_page, is_page(‘slug’), is_page(id) not working
- Need help on creating If-statement for custom meta fields
- How to make gravatar.com avatars conditional?
- Loading Scripts on Specific Pages
- Condition function for is parent category?
- Conditional Statement – Best Way to Remove Nav on Contact Page
- Proper syntax for simple conditional bloginfo language
- wordpress is_page() problem
- Location-Based Content
- Personalized message for each unique password-protected page
- Conditional Shortcode image display
- Change Woocommerce order button page on particular page
- Change a url / link if a user is logged in?
- to create own conditional tags for business directory in wp
- How to use “Cases” instead of “IFs” for conditional logic
- Which is the better way to write a conditional statement? [closed]
- Is there a way to password-protect part of a post?
- if/Else have_posts Else fails to echo message to page
- Conditonal statement for iPad
- Return function only on certain pages
- How to write this conditional statement?
- Conditional for Custom Post Types
- Date-Based Conditional Tag
- Message box when accessed from iPad
- Show this code if user has previously left a comment
- Insert a conditional in the middle of a function to give it 2 different outcomes
- How can I use ‘edit_form_after_title’ conditionally?
- Force Log in to view a page
- Conditional loading of CSS for my plugin
- Looks like this if condition is not working [closed]
- Generating images from an array of categories
- WP conditional site logo and header block
- How to know if the most recent article
- Widget logic conditional widget
- How to display image on condition that a selection has been made
- How to Conditionally Not Display a Link Based on Current URL?
- Allow users to only CREATE one single (custom) post
- If statement to check for post_content
- why is my custom loop failing?
- Conditional sidebar menu
- What is the best way to disable my WP website if the user has adblocker on? [closed]
- How can I determine if a post has an image attachment?
- How do I place content on archive pages but not on main page?
- If Post Type equals, then display X content
- Multisite Conditional (if blog_id?) in a page template?
- how to test for attached image
- Conditional Statement – check if post has an attachment image
- How Can I Register Menus and Widgets Conditionally Based on Theme Options/Settings?
- Checking if a Page has an Associated Term?
- Performance-wise, is it better to enqueue a (small) script on every page or test to see if it’s needed?
- different child theme for subdomain
- Search result conditonal tag
- how to know if the post has pagination () or not
- Conditionally load CSS/JS/PHP in wp-admin if using a mobile device
- Conditionally set post_content in wp_insert_post
- Conditional for 404 page not work
- If Specific Post, Link Elsewhere
- Conditional PNG Overlay in Custom Post Type Loop Depending on Post Type
- Change content of page in child theme using plugin
- Redirect to a different page through registration, depending on page
- What is the correct way to write this conditional statement?
- Displaying a widget in sidebar only when no other widgets rendered?
- Conditional display for custom fields/taxonomy
- How can I detect hierarchal relationships beyond children (grandchild, great-grandchild, etc)?
- Cluster WooCommerce products in each Category Archive by Tags assigned to products
- Changing select options based on previous select with PHP & AJAX
- Specific coditional usage [closed]
- How do I display something on a particular category page?
- Exclude a category from a query that includes its parent category
- Check IF single OR multiple custom data has been entered
- Problems with my conditionals in single.php by category
- If have posts a week old, display, else display a different loop
- Target pages using a specific page template
- Conditional Fields for Contact Form 7 not working and displaying [/group] in output
- How to make widget appear conditionally
- Conditional/Check: IF author has no First Name THEN
- award points to a user each time they update their cpt post
- Home Page Template – Specific Category
- How to make a conditional statement within $output in shortcodes.php?
- Conditional function for excluding first image from content, not working
- Limit page template choice by page title or ID?
- Using conditional statements in place of custom Page templates
- Getting false for is_home() on Posts page
- Loading a stylesheet conditionally & verifying CSS
- Add filter conditionally to a page
- Using Switch Statement to Change Image According to Last Digit of Topic ID
- Jetpack: Display Site Title when no Site Logo
- Best Method to Switch Between Terms (Custom Taxonomy)
- How to make a hyperlink conditional according to whether you are logged in or not
- Display WP Start bar on front page only
- Using conditionals, maybe from a DB, to register & enqueue files, for varying pages, in functions.php
- Custom Meta Box If Else Statement
- How do I reformat this to add php inside php?
- ACF loops false value with repeater and checkbox
- Change page content based on dropdown selection