You should not use echo in this case. Please visit the function reference of get_template_part. As you will see, there is nothing to print:
get_template_part doesn’t return a value and doesn’t warn if it fails
to find a matching template file.
Additionally, I recommend that you check out this question: Should we use get_template_part() in functions files instead of include_once?
Related Posts:
- Right way to update widget on dynamic new input field
- Best practices regarding the creation of custom widgets?
- New checkbox in custom widget isn’t saving data
- Extend WordPress Audio Widget to accept HLS (.m3u8) URLs
- Adding A New Widget to WordPress Disables the Existing Widgets
- How to add css class to cloud tag anchors?
- Is it possible to remove the “standard” post format?
- Issue with get_theme_mod returning a blank value instead of the saved value
- Modify search function in WordPress (TwentyTwelve)
- Show/hide Widgets in Dashboard Based on Current Advanced Custom Fields Option
- How to customize search result page title?
- Auto delete WordPress images/thumbnails (all sizes) and featured after X days/hours, or similar?
- remove from text-widget
- Removing Unnecessary Text from Admin Menu without CSS
- Display WordPress Search
- How do I change parameters without changing the core
- Customising widget titles/headings in WP 5.8
- How to add a rel attribute to images that contains their categories?
- Preferred Use of home_url()?
- What is the most efficient method for loading widgets in functions.php
- Custom function for user register in wp?
- Ajaxing function in widget class
- Refactor create_function
- adding custom classes for tables
- Customizer field value into functions.php variable
- wp_dropdown_categories and custom attribute
- Adding widget to dashboard with wp_dashboard_setup not working
- Automatically wrap multiple images in div
- Ajax not working properly
- is_customize_preview() like function to check if Customizer “Live Preview” in JavaScript
- How to customly read JWPlayer’s “Playlist” items by using its “playlistid”?
- Include default functions and methods
- Hard-coding custom menu elements for menu manager
- Twentyten Child Theme: header images display messed up in admin panel
- How can I modify all existing tags while keeping the urls themselves?
- IF Statement on Button to make it complete and “uncomplete” based on user action / click
- Gravity Forms Button Text
- Find resources dynamically loading and change or add to the url
- When sale price is 0.00 show only regular price
- Unable to login using username
- Move Custom Fields on General Settings Page to New Location
- WordPress Shortcode function display outside of widget
- Get rid of the widget Item Class=”widget-item”
- Condition OR for current user ID
- How to retrieve the current post’s generated featured image size?
- Custom Behavior when Adding New Custom Post Type in Dashboard
- Where do I store custom functions that call custom page template files?
- Can’t Write Custom Widget Code In One ECHO
- Why There Is No “get content by ID” Function
- Wp-query Order By problem
- Create custom function for hero image
- Randomizing wp_tag_cloud() in child theme
- login_headertitle is deprecated since version 5.2.0
- How to append classname to body tag if guest user
- Where do I go to edit this area? [closed]
- Replace plugin function with a custom function?
- Why is it so hard to add a class to the tag in the sidebar widget?
- The correct way to add a JavaScript in the functions.php [closed]
- Different favicon on different pages
- Passing user enetered value in widget: number of words, for example
- Register_Sidebar overwriting itself and doesn’t exist in global $wp_registered_sidebars;
- Problem with images URL after filter applying
- Function to replace comment’s accented characters before posting
- widgets not working
- the_widget() inside functions.php
- how to display a page before the home page
- loginout function customization
- Creating a custom wordpress widget and stopping js from running twice(once in active widget once in widget selector)?
- implementing a centralized content “show-do-not-show” toggle?
- How would I make a function to dynamically determine if user is logged to change navigation menu text?
- How to display this meta data (an array) in form of a function (created with a custom write panel)?
- WordPress – using sessions?
- Include widget file in functions.php of child theme
- Save_post – Warning: Cannot modify header information
- How to use WP conditional tag in a functions.php with OCEANWP Theme?
- Modifying a WordPress Plugin
- CF7 select value get to function and reciept value from function
- Widget is displayed in two places
- Woocommerce custom calculation function
- my wordpress doesn’t save items to customized widget area
- Remove all video attachment, both files and post/postmeta from database?
- WordPress function with attribute pass to template
- Will dequeueing in child theme functions.php file prevent Google Fonts from loading?
- Copying a widget class to functions.php results on a blank page
- Replace image attributes for lazyload plugin on image elements with specific class
- Help! Need a different logo on my main page from my other pages
- How to make an If Else on Excerpt Filter
- How to replace words in my posts and saved new words
- Expanding a function to call a plugin or show a link
- How to programmatically GET (to know) which Sidebar (or) which Menu is being used on Different Pages?
- Register a widget area when a theme option has been saved?
- functions.php / replacing div’s with new ones?
- Give a function a unique ID
- Post variables not displaying correctly in custom function
- Add the title of a widget as an ID – for anchor links
- Problem with removing characters “<” – WpAllImport
- How to crop image in WordPress with aspect ratio for any size of image
- multible shortcodes (for differnt values) with one function
- Swap WordPress “Widget Area” based on Page Template
- Customizer cuistom CSS Priority ordre Issue