Timeline for View Achive with Category Filter, but Page per post not working
Current License: CC BY-SA 3.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 21, 2013 at 5:03 | comment | added | Chip Bennett |
Usually, when referring to WordPress Themes, a template file is a file used to render the front-end output, as found in the Template Hierarchy. Anything else is either a template-part file (called from within a template file), or else a functional file (functions.php , or any file included in functions.php , that defines Theme functions/functionality).
|
|
Jan 21, 2013 at 4:23 | comment | added | Shiro | Sorry for the misunderstanding, My understanding the template file means functions.php (one of the template file), actually you are refering to Child Theme. I will use site-functionality Plugin. Thank you so much Chop Bennett, have a nice day! | |
Jan 21, 2013 at 2:38 | comment | added | Chip Bennett |
In a Child Theme, you still wouldn't put it in the template file, but rather in the Child Theme's functions.php file. But I would go with a site-functionality Plugin as the better solution. Here's a tutorial for creating a site functionality Plugin.
|
|
Jan 21, 2013 at 1:52 | comment | added | Shiro | Thanks Chip Bennett, I learn a lot from you. As you said never put in the template file, but in the beginner you mention can put in child Theme file, so which one is better? I am still new in WordPress, do you have any more tutorial or learning site regarding this? Thanks! | |
Jan 21, 2013 at 1:51 | vote | accept | Shiro | ||
Jan 21, 2013 at 1:35 | comment | added | Chip Bennett |
Using a commercial Theme or not should make no difference. You can put this in a Child Theme functions.php file, or you can use a custom, site-functionality Plugin, and put it there. But a pre_get_posts filter callback should never be put in the template file, because by the time the template is loaded, the query has already been run, and the posts have already been fetched.
|
|
Jan 21, 2013 at 1:31 | comment | added | Shiro | Hi, this code is required add to functions.php, as I am using premium wordpress theme, it will affect when I do the theme upgrade. Is it possible way I can do in category-7.php, so it is independence? | |
Jan 19, 2013 at 15:59 | history | answered | Chip Bennett | CC BY-SA 3.0 |