That is a weird way to do it, shortcodes are really meant for inserting into the editor, if you want to program some functionality it’s better to go straight into the template/code itself.
//check if post format is gallery type
if ( has_post_format( 'gallery' ) {
echo do_shortcode('');
}
Related Posts:
- Update caption for metabox gallery images
- How to show post format gallery metabox image caption in the post front end
- Get image captions for images on gallery post format metabox
- custom meta box data not saved
- Unable to save multiple images in wordpress
- How to HIDE everything in PUBLISH metabox except Move to Trash & PUBLISH button
- Removing panels (meta boxes) in the Block Editor
- How can I create a taxonomy meta-box with search suggestions but no new terms input?
- How to Add Reminders/Notes to New Post Meta Boxes
- How to reorder meta box position?
- Put the media uploader in a metabox
- Custom Meta Boxes: multiple fields within a repeatable field
- Metabox date month number to word
- get registered metaboxes by post type or post ID
- Remove metabox from specific page template in admin
- Is there a filter/action to add content to WP admin metaboxes?
- Attach Files Metabox
- How do I create a meta box for dates?
- esc before saving or before displaying does it matter?
- Add a meta description to home page?
- Display list of tags as drop down menu or radio buttons in a meta box?
- Is there a predefined callback function for custom categories?
- How to List all Sidebars in a Metabox
- Save checkboxes of a metabox with a foreach loop (invalid argument)
- prevent post submission
- Add template meta box to category edit page?
- How do I migrate meta boxes from the Classic Editor to the “side area” in Gutenberg Editor?
- Multiple Checkboxes Metabox
- Why is save_post hook not running?
- Consolidate Metaboxes into 1 Big Metabox
- Set the default value as checked for a meta box checkbox
- Alternative to esc_textarea
- Display oembed in repeatable metaboxs using CMB2
- Undefined ‘post_type’ error on Add new page
- metabox wordpress show in frontend
- How to use get_post_custom function on the blog page?
- Multiplicate entry on update_post_meta
- Populate meta select box with child pages
- Problem with meta box in Links
- Post Meta not saving when have empty post
- Creating an “admin only” meta box with WPAlchemy. Getting a fatal error on front-end when using current_user_can
- How to modify Publish metabox?
- Hide Polylang metabox from the post edit sidebar
- Store multiple textarea data in database from a metabox
- Custom Attachment Caption Fields
- Controlling Meta Box Height
- Custom Meta box only returns most recent value on page
- How to prevent further updates of custom meta when using actions to set one meta based on another
- Stop saving process when metabox is invalid [duplicate]
- how can i do metabox [closed]
- How to add meta box for image upload using WordPress media uploader?
- why add_menu_page use simple function as arg while add_meta_box a call back?
- List all sidebars in metabox
- Output from Meta Box Array
- Have mu-plugin remove meta box ONLY if it isn’t already removed in functions.php
- How to show the value of specific key from nested array?
- Getting metabox value?
- Hide Page Title with Post Meta
- Cannot remove meta box added through OOP
- Meta box does not save or update
- WP admin display custom field if another field value is “Female”
- Show button if meta box has content, else hide
- Post Excerpt field only showing for default administrator
- Is ‘repeatable’ a field type for meta boxes?
- Checkbox in post not saving value
- Custom loop attached to link
- post meta – problem : copy the same meta for all the articles
- ACF – Hiding metaboxes through screen settings doesn’t work
- Remove Username and just show Name in Author Metabox in backend
- how can I make this metabox area
- get_post_meta giving errors while creating a metabox
- how to Add Meta Box with featured image settings and To Edit Post Screen For Inline Styles (css box)?
- Metabox not saving values
- Update Post Meta in Front End with a form
- get_post_meta not working on my custom-function page
- Metabox with checkbox is not working true!
- Featured Gallery to custom post type
- Displaying a Metabox linked to post settings for all users
- Can’t get meta values to save
- Custom WP Meta Box – Use data from within the post screen inside meta box
- How to show select_advanced content instead of ID?
- Removing Meta Generator
- Error when adding Meta Boxes, but only when adding 3 with the same callback
- Using Meta Boxes in a Custom Page Template
- A correct hook for saving meta boxes data
- update_post_meta does not work
- Hooking into the Meta Boxes (Name/Web Address/Description) on the ‘Add New Link’ Page
- Custom carousel with meta box data
- show title if one of post meta exist
- Query a Custom Post Type to another CPT via Metabox
- when saveing $meta_box i get Undefined index error
- Adding a Custom ‘Now’ button under ‘Published on’ header to return current date and time
- Adding meta boxes to custom post type
- Meta boxes not showing up
- Custom metabox with App Store / Google Play links
- Metaboxes not saving data
- How do I create a Meta box that can be repeated? (with an image section and text area)
- Need help, Passing variables with get_post_meta
- Input select option Change Content in Metabox
- Is there a way to remove the Add boxes from the Screen Options menu metabox?