Will it cause any problems if I use get_template_part() like this?
I can’t really see any answer other than… no. But that’s based on not knowing what you actually mean by “problems”.
If you mean “is this code totally bulletproof no matter what scenario you could possible throw at it” then yes, it may cause problems – I don’t think you can cover for every eventuality.
But if you mean “am I using the WordPress API in the manner intended/am I doing it right”, then yes, you certainly are.
Related Posts:
- has_post_format() vs. get_post_format()
- What difference does it make if I enable support for video post format?
- How do I remove the post format meta box?
- Adding post-formats to Twenty Ten child theme
- Is there a real life use case for post formats except for microbloging?
- Renaming post formats after Gutenberg
- What is the recommended behavior for the post formats?
- Custom Post Formats
- Target all posts that are NOT aside or link post formats
- Filter the first from Quote Post Format
- Displaying all Video Post Formats to Page
- Display Post Format as a String
- Different markup for each post format
- Post Format single-loop.php using get_template_part
- How to recognise on which site the content is being rendered?
- post formats – how to get the relevant content part?
- Post formats for Pages not saving
- How can I remove the first video from a post and feature it?
- previous_post_link/next_post_link disappear when excluding by post_format
- Usage of post_formats
- how to get list of post formats supported by theme?
- Formatting Standard Post Format
- If post-format == ‘gallery’ conditional
- Adding new post format on plugin activation
- post formats – where’s the difference: “aside” vs. “status”?
- How to get the id or url of the image in an image post?
- How do I get standard posts to open up in their own template when using get_template_part()?
- get_template_part() Not Working in Loop
- About post format
- Smart post format loop problems
- “post-format” code snippets list [closed]
- wordpress post formats
- How to display quote format by preg_match function?
- I would like to have a quote page just to show quotes
- How to display list of video post on video section?
- Paste from word not preserving formatting
- How to treat post formats?
- Post formats and template hierarchy
- Change standard post format metabox
- Next Post Link in format
- Mass post format changer?
- Displaying cf post formats with oembed
- Custom formatting
- How to filter by post-format in admin?
- Check if partial file is called from within header.php or footer.php
- Is it possible to remove the “standard” post format?
- Custom post types vs post formats : future-proofing – is one less “future proof” than another?
- Does WordPress generate an automatic page for post formats?
- Pass a variable to get_template_part
- Get template part vs locate template function
- Get post only from ‘standard’ post format
- How can I add dropdown widget/box to admin post page?
- Single Page WordPress Theme – Using page templates
- _wp_page_template to dynamically use template
- Templates & CSS – Proper Programming Practice?
- Which custom query am I in and how can I access its properties & methods?
- Passing variables to template parts
- Correct way to use get_template_part() and get_post_format() with custom post types?
- Possible to use pagename inside get_template_part?
- How to pass variables with get_template_part?
- Unable to include a template
- How to make get_theme_mod work with AJAX in the customizer preview
- Valid HTML in Template Part
- get_template_part and template file names
- How to filter posts by post format “standard” from wp-json api?
- WordPress add post format support not working
- URL of a custom post type’s post format archive?
- Assign post format to categories
- How to exclude post formats from wordpress recent posts in a tabs widget [closed]
- Check for the main query from the template
- Get_Template_Part And Two Global WP_Query On Frontpage
- How to make the ‘delete’ button inactive on some categories?
- Custom post type index (maybe using get_template_part)
- How to pass a variable to get_template_part that’s updated every time the template part is called?
- Does get_template_part() content gets parsed if it’s not executed?
- Get_template_part seems to be ignoring my template
- Display the video of a post_format Video
- Is there a way to retrieve the calling template part?
- How to create Page templates for showing Blog posts in different layouts?
- Is “get_template_part” hierarchy possible?
- How can I correctly redirect user to the submitted post and define a template for each new post in WordPress?
- A better code for no post format?
- Help Combine These Two PHP Codes
- On click some element i want to use some template
- Template not loading with get_template_part or locate_template
- Load templates, pass arguments, and render output from functions.php
- Can I set a global base path for get_template_part?
- Is_Page doesnt detect my page
- Display a custom 404 page without a redirect
- How to get value from radio buttons meta box, and return different contents?
- Permalinks Question: Adding a prefix ONLY in front of all posts with the ‘video’ post format
- Query posts in current category but not attachment format
- Why is my custom post type shown in the wrong place?
- When to use content-pagename.php?
- Theme parts path location dump
- Custom single.php files for different post formats
- how to modify request to get_template_part()?
- If I define a variable in header.php, how do I make it available to templates?
- Headers already sent error with get_template_part in REST API call
- get_template_part() does not render after the ajax request