There is no “default” post format type, though internally in core, a post that has no post format assigned is usually referred to as standard. So, your first conditional will return false using post-format-normal because there is no such post format – but would still return false using post-format-standard.
You could reverse the conditional, and check for gallery post format first. Note that you could use either 'gallery' == get_post_format() or has_post_format( 'post-format-gallery' ). (Personally, I find get_post_format() to be a bit more intuitive.)
In any case, you would reverse the conditional like so:
if ( has_post_format( 'post-format-gallery' ) ) {
flexslider('index-post-image');
} else {
// Fallback output here
}
Note that you also have syntax errors in your code, such as nested PHP tags.
Related Posts:
- Only get_posts of certain post formats
- static variable loop not working in WordPress
- Show content if parent page has children
- Current post’s author name in the author meta tag
- Conditional statement for parent, child and grandchild pages
- Trying to use Ternary operators with WP Conditionals
- How does WP detect format type (and can I make use of this)?
- When is is_admin() available?
- Check if current page is wp-admin
- Second Navigation inside header
- Using is_page() in functions.php not working at all
- Output 2 items within the Loop
- conditional statement for custom taxonomy
- How to enqueue CSS and JS only on specific template?
- How to filter posts by post format “standard” from wp-json api?
- Get first URL from post content
- how could I load a different template part by page
- How do I use this PHP library to access OpenGraph data in a child theme?
- WordPress add post format support not working
- trigger html cleanup for all posts
- WordPress, AJAX and pre_get_posts using conditional tags
- If tag equals then show else show
- Conditional statement for dates
- How can I display a div ONLY if it is not a certain term page
- Don’t show certain div on front page?
- If ‘editor’ is empty, then
- Add class to DIV depending on page loaded
- Almost Done… Post Format Code
- How to: Conditionally Enqueue JS and Stylesheets, for Custom Post Type (Single and Archive Templates)
- Undefined index for default custom theme option
- Remove conditional tag from header
- Display an image based on field value
- Multidimensional Array
- Display the video of a post_format Video
- “if parent category is” conditional?
- Wrap posts p tags in div
- conditional: if is page, and all subpages
- Woocommerce getting top level category parent and make all sub categories have the same template and menu
- page 1 is not paged
- How to add Text before my Custom Term and hide it when empty
- How can i create a function tag in my plugin
- Add code to the header of posts by particular author
- Display specific page if user signed in
- How to get Post sidebar & footer including html like get_the_content() which only gets content section?
- Widget Logic – display on page and all child
- Need to adjust condition to say if I’m pulling categories from a post, to pull only the first one
- Setting ‘post_format’
- if user is admin display admin link and logout link else display logout only
- Add code only for blog posts
- How to define Og Meta Tags in header using conditions [duplicate]
- If Month=Particular month display content [closed]
- How can I add WordPress Audio Player as featured audio in Audio Blog Posts?
- How to echo a different field if another field is empty?
- Adding else if conditional statement to purchased theme
- Custom single.php files for different post formats
- Conditional in foreach loop is outputting content twice
- Advanced custom fields Repeater conditional statement not working [closed]
- Load slideshow.css file only if Slideshow is checked / on
- Issues trying to add a href statment with PHP into a PHP Echo Statement [closed]
- if is specific custom post in cpt
- advanced custom fields: repeater field within conditional statement [closed]
- WordPress Block Editor Gutenberg running code inside ! is_admin()
- How to make my scroll bar show under condition
- Side bar only if it’s not a single post or a specific page
- WooCommerce: Custom dropdown for variation selection
- Only show image from custom field when present
- Cinema site, retrive the movies that actor play in
- How to include custom code on a page that’s set to act as homepage?
- retain querystring values when savincustom options in admin
- PHP if statement works in template files, but not header
- How Can I Edit the Registration Code?
- Error while setting role
- Editing a PHP file to include a small text piece on every page
- Get categories names as an array to use it in theme settings
- Should i use the wordpress Options table or to create database table..?
- variable value disappears in a second loop
- Force Users To Relogin
- unknown issue in ‘header.php’ preventing theme from displaying fully
- Hide a div to subscribers(user role) in one page (is_page)
- Security updates to 3.3.2
- Where is this function’s callback getting its arguments from?
- How can I use a sliced image As banner? [closed]
- persist a variable set in header.php all the way down to footer.php
- Echo title attribute php
- Can a page contain php code?
- Last class on last headline?
- Unable to Find Space in Custom Function
- Is it possible to display a DIV to not logged in users and then change it for users who are logged in?
- Strip Paragraph Tag
- Unable to process php via shortcode
- working with term_relationships table
- Creating a blog on my companies new website using WordPress but I have sidebar issues
- Creating a mobile site by adding a new class to the body tag from functions.php
- WordPress plug-in for dynamic download link?
- Using WP functions such as the_title() in an included php file
- GET problem in WordPress
- WordPress gallery shortag
- wordpress admin plugin menu custom css
- Help with page nav?
- Show recent posts starting at a specific number archive