Hi,
you can open up your_theme_root/html/category.php file and then find the line with "new WP_Query" in it: this is where we query for posts. You can modify the parameters sent to that class to modify the query; to change the order you can set the "orderby" parameter (please see here:
codex.wordpress.org/Class_Reference/WP_Q...6_Orderby_Parameters
) to sort the posts to your liking.
Please don't PM unless requested
Consider using the custom stylesheet for all your CSS customizations:
gantry-framework.org/documentation/wordp...custom_stylesheet.md
.
Please provide the URL to the issue.
And please mark the thread as solved if the issue is resolved.
Here's some code, may be of use to someone....
It would be lovely to have this functionality built-in on a future release.
I have to believe this is an everyday need for many wordpress admins
Hi,
worth to add that Gantry supports template hierarchy as well, so instead of using conditional comments you can create different template files for each of the categories. In order, Gantry first looks for category-SLUG.php, then category-ID.php and if they didn't exists, category.php file is used.
Please don't PM unless requested
Consider using the custom stylesheet for all your CSS customizations:
gantry-framework.org/documentation/wordp...custom_stylesheet.md
.
Please provide the URL to the issue.
And please mark the thread as solved if the issue is resolved.
That's great. So I can just copy the contents of category.php to [MYSLUG].php and edit the query as needed for that category only. Gantry will load the custom php file automatically, correct?
Hi,
yes though keep an eye on the naming convention; the filename should be: category-[SLUG].php.
Please don't PM unless requested
Consider using the custom stylesheet for all your CSS customizations:
gantry-framework.org/documentation/wordp...custom_stylesheet.md
.
Please provide the URL to the issue.
And please mark the thread as solved if the issue is resolved.
I have my custom category pages setup but they do not follow the gantry category rules. i.e. I want to show excerpt and title links, not author or meta data. How can I accomplish this with a custom category page (I just copied the category page, altered the name to include the slug and changed the query)
Hi,
I think I know what the issue is, can you please try this? Open up that custom category template and find this line:
$page_type = basename( __FILE__, '.php' );
and change it into:
$page_type = 'category';
It should fix the issue.
Please don't PM unless requested
Consider using the custom stylesheet for all your CSS customizations:
gantry-framework.org/documentation/wordp...custom_stylesheet.md
.
Please provide the URL to the issue.
And please mark the thread as solved if the issue is resolved.