Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

get-template-part

Filter get_template_part() $args array

August 5, 2022 by Magenaut

I’d like to be able to pre-populate all occurances of the get_tempate_part $args when setting up a theme.

Categories Q&A, Wordpress Tags filters, get-template-part Leave a comment

Headers already sent error with get_template_part in REST API call

August 5, 2022 by Magenaut

Crosspost from StackOverflow

Categories Q&A, Wordpress Tags get-template-part, php, rest-api, theme-development Leave a comment

Template part inside shortcode, unexpected reult

August 5, 2022August 4, 2022 by Magenaut

I am attempting to call a template part via a shortcode. Ive read all about how to do this over and over on this site and yet after having tried a number of things still am unable to call a simple php echo time string. The file name is test-one.php .Here is what I’ve tried:

Categories Q&A, Wordpress Tags get-template-part, php, shortcode Leave a comment

Get template part based on custom taxonomy term

August 4, 2022August 3, 2022 by Magenaut

I have a custom post type and I’m trying to call up different variations of the navigation based on the custom taxonomy slug. I’ve done this fairly easily with normal posts, like so:

Categories Q&A, Wordpress Tags conditional-tags, custom-post-types, custom-taxonomy, get-template-part Leave a comment

Is there a variable for a template parts name?

August 3, 2022August 2, 2022 by Magenaut

One you have called a template with get_template_part() (or locate_template()) is there a way to know what template you are in.

Categories Q&A, Wordpress Tags get-template-part Leave a comment

Passing variables through locate_template

August 3, 2022August 2, 2022 by Magenaut

While I’ve typically used include or require on their own to save long term code maintenance I’ve started to use get_template_part and locate_template as using built in WordPress stuff is always best.

Categories Q&A, Wordpress Tags get-template-part, include Leave a comment

How to add custom content template part for a custom post type on main query using a plugin

August 3, 2022August 2, 2022 by Magenaut

I have a custom post type paper defined in my WordPress plugin that I show along with standard posts in the main query via:

Categories Q&A, Wordpress Tags custom-post-types, get-template-part, plugin-development, plugins, templates Leave a comment

Is it possible to override the result of get_template_part()?

August 3, 2022August 2, 2022 by Magenaut

I’m working on a child theme, I strongly prefer not to override the main template files in order to maintain simplicity of the child theme as well as minimize the amount of code and maintenance over time.

Categories Q&A, Wordpress Tags child-theme, get-template-part, templates Leave a comment

How to use get_template_part()?

August 3, 2022August 2, 2022 by Magenaut

Could someone please explain to me how this function works? I know what it does but when I look at the source code in the twenty_ten template, I don’t get how all loops are being collected in one single loop.php ( I saw that file too).

Categories Q&A, Wordpress Tags get-template-part Leave a comment

Combining shortcode and get_template_part

August 3, 2022August 2, 2022 by Magenaut

I manage a wordpress site and have created a template part that I usually paste below the content.

Categories Q&A, Wordpress Tags get-template-part, shortcode Leave a comment
Older posts
Page1 Page2 Next →
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress