We use either the category ID we found out earlier – in this test case 2 – or the category slug – in this test case sample-cat. key – type in either the category ID or slug in this field the template automatically detects what we’ve typed in.slug – use the category slug to load the posts (will only work when using pretty %postname% s).catid – use the category ID to load the posts.The template supported custom fields are: If the custom fields are not visible under the page content area, we’ll need to enable them.Īfter writing in our page (intro) content and enabling the custom fields (if necessary), we’ll have to actually add a custom field for the page. While editing the page we wish to use this template on, we’ll need to add custom fields. What we type into our page content is what WordPress will display as the intro. This is a page template, so it will show up in the page templates list when we’re creating/editing a page while using one of our themes. We can find the slug by editing the category itself.We can find the c ategory ID by hovering the Edit or View buttons in the category list we’ll see the numeric ID in the URL the browser displays.What we also need to know is the category ID or slug (when we’re using pretty s). To get started, we need to have a category with posts we wish to display an intro to. If you have any trouble, please let me know in the comments section below.Our themes (Mantra since v2.0.4, Parabola since v0.9, all other themes since first release) feature a special page template titled “Category Page with Intro” which allows us to display a category of posts coupled with a custom intro to that category. It’s quite simple and easy to display posts from a specific category in WordPress. The changes you just made are saved to the sidebar.php template. Just change 6 to whatever number of posts you’d like to display (there is no limit!), and change 60 to the specific category ID number that you want to use. You can change these numbers to suit your specific needs. In the first line, I indicated the following: showposts=6&cat=60. Rel=”bookmark” title=”Permanent Link to ”>
Wordpress theme 2017 how change categories code#
Type the following code directly above the ending tag: If you’re using the Twenty Ten theme, the ending tag is the second-to-the-last line. Locate the ending tag at the bottom of the template for the theme you’re using.If you want to display content in a sidebar, for example, choose the Sidebar template: sidebar.php. Click the template in which you want to display the content.Click the Editor link on the Appearance menu.If the ID category is 60, enter cat=60.įollow these steps to add the tag to your template: cat=X: This parameter tells WordPress that you want to pull posts from the category with this specific ID number.If you want to display only six posts, enter showposts=6. showposts=X: This parameter tells WordPress how many posts you want to display.Here is an example of two parameters you can use with the tag: Now you know the category ID number, you’re ready to add the tag to your template. Look in the status bar of your browser to view the category ID number.On Categories page, Hover your mouse over the name of the category that you need the ID number for.Click the Categories link on the Posts menu.To find The unique ID number for a category follow these steps: Instead, you can visit this page in the WordPress Codex and read about the options available with this tag. The tag lets you pass so many variables and parameters that it’s impossible for me to list all the possibilities. The template tag contains several parameters, and you can display different types of content, such as posts in specific categories and content from specific pages/posts or dates in your blog archives. If you have a category called “ Themes“, and you want to display the last three posts from that category on your front page, in your blog sidebar, or somewhere else on your site, you can use this template tag. Just place this template tag before The Loop, all you have to specify from which category you want to pull information. In WordPress, it is possible to pull a specific content through template tag.