get_template_part
takes slug as first parameter and not filename.
So it should be:
get_template_part( 'template-sponsors' );
And with more details… This function takes two parameters:
get_template_part( string $slug, string $name = null )
And inside of it, the name of a file is built like this:
if ( '' !== $name )
$templates[] = “{$slug}-{$name}.php”;
$templates[] = “{$slug}.php”;
So, as you can see, the .php
part is added automatically. So your code will try to load file called template-sponsors.php.php
and there is no such file, I guess.
Related Posts:
- Retrieve multiple values passed to a single attribute in a shortcode
- Display a text message if the shortcode is not found?
- My shortcode is showing up twice
- Custom plugin issue when trying to use the shortcode twice on a page [closed]
- Making Quote Plugin more efficient
- custom shortcode will not display the wrapped content
- Append HTML Using Shortcode
- Plugin CSS not enqueing
- Showing content from one page on another
- Is it possible to define variables in a wordpress shortcode, and then call the shortcode using a specific variable?
- Short code template + ajax
- WordPress shortcode returns the data before
- Action Hook Inside WordPress Plugin Shortcode
- What is the difference between Null vs Empty (Zero Length) string?
- Why wp_remote_get() fetches certain web pages while it doesn’t work for my localhost?
- How to Create custom block for displaying information in content section which act like shortcode
- Display a custom name when the user has no name settle in his account
- overwrite wordpress gallery with custom gallery shortcode
- How to return html as a string from php for WordPress
- Shortcode Works for Logged in Users but Not Working for Guest
- How can I put a custom field as the link of a button shortcode?
- using a shortcode in a hyperlink
- WP Custom tables query
- redirect user from login page if is logged
- Custom plugin with shortcode not working
- Should I use spl_autoload_register() in my plugin?
- Using register_activation_hook in classes
- Is there a way for a plugin to add an attribute to the tag of a theme?
- Nested shortCode functions in the functions.php file
- Hiding WordPress Plugin Source Code
- How can I get content inside one shortcode to another shortcode?
- wp_loaded hook block script enquequing
- Custom filter in admin edit custom post type responding with invalid post type?
- How to find error in my code when the error message is pointing to WP core file?
- How to access global variable $menu inside a class function
- How to exclude category ID from Looper in WordPress
- Custom user login page by creating a plugin
- Add a specific part of current category page url to shortcode
- Calculating a large number of MYSQL queries as customshort codes, slow
- Singelton class does not work, multiple initialization on page reload
- How to upload a file to a folder named after the user_id via plugin
- Can’t access variable outside for loop
- Whitelisting items from custom options page
- Add_menu_page not displaying the menu in class based plugin
- adjust section according to country?
- How can I dynamically update the class in my shortcode?
- How to Reference/Echo Variable from Another PHP Function
- Replace shortcode in substring
- Does wordpress templates always in files or in database?
- How to use html inside a functions.php code?
- Extend Woocommerce Widget Class – WC_Widget_Product_Categories
- plugin add action hook is not working :
- Capitalize Shortcode Value on Output
- Why is my str_replace not working on short code submitted by front-end?
- wordpress admin plugin menu custom css
- Shortcode not staying inside div tag
- Hooks for post saving make a post-new.php to load latest post’s data
- Shortcode function doesnt work without caption
- Posts are not looping through correctly
- Using flickr api in custom wordpress plugin
- Toolbar Hidden in a Virtual Page
- PHP: $_SESSION destroyed after page reload for my custom session
- Payment field disappears on custom Paypal plugin
- Adding image upload in tag section – WordPress plugin development
- Display logged in user name and lastname on page
- How to Remove Theme Style CSS inside Custom Plugin?
- Creating plugin with front-end pages
- How to Send Pingbacks for all Posts in WordPress?
- I am having errors with checkout on wordpress
- Replace background image with post thumbnail in shortcode
- Conditional formatting on data fetched from MYSQL
- How can I update the price when someone enters postcode or zip code in woocommerce checkout page?
- Update user meta when an external link in admin notice is clicked
- Is there an option to execute javascript file only on plugin activation
- How do I remove an action hook inside a class that is called by another class?
- Display current user metadata on WordPress page
- Add Shortcode to ::before class
- Shortcode’s output to use as other shortcode’s parameter
- Ajax in a class instantiated via shortcode
- Parsing webhook from Shopify in WordPress
- Add two or multiple functions in WordPress Post or Page
- Submit to itself don’t work
- perform mathematical operation on shortcode
- WordPress / PhpStorm / XDebug and plugin_dir_path issues
- Update same content in multiple posts at once?
- Create page in templates for pages or the pages manager?
- Send data from plugin to external database
- problem multisite with blog id
- See output of a sql query while plugin installation in wordpress
- Shortcode Display From WordPress Dashboard Page Without Using post_id
- Why this plugin is not working?
- Permission error on plugin save
- Do_shortcode on PHP file outside theme ALMOST works
- How to execute add_action() function from custom plugin to Crontrol plugin or do_action()?
- Custom Shortcode with Dynamic Button
- Shortcode for Visual Composer Grid fails turning string to integer
- HTTP 500 Error after Creating Shortcode
- Woocommerce Convert existing order to the cart
- Redirect posts to post editor page based on query string
- How to execute a shortcode within a custom field?