February 19, 2014 at 7:21 pm #4648jasonwehlingMember
I have the Agile WP theme installed, and I have the Portfolio displayed on the Home page (via default page section code). That all works fine. However, I want to control the order of the portfolio items in that page section. The Segment code doesn’t specify any option like that. I’ve also played with the publish dates to see if I could control it that way, but that doesn’t seem to have any effect.
What can I do?
JasonFebruary 20, 2014 at 1:09 pm #4674RaghavendraModerator
Are you sure the date was changed right? I did make the change on my local installation and online too and looks like the change is taking effect since the default ordering is date based. Can you post me a temp login to your site here as a private message? Thanks
BTW, we did have ordering based on order attribute earlier but had to remove the same since it was forcing the users do some extra work. If date ordering does not meet your need, we need a simple one line code change to the page template you are using if you need complete control of the ordering. This will use order attribute part of portfolio item.February 20, 2014 at 4:29 pm #4693jasonwehlingMember
I think I’m doing it right. I’m going into the Portfolio section of the admin area, and clicking in to edit a Portfolio item from the list. There, I edit the “Published on” date. I’ve tried very old, and very recent. Neither seem to affect the order on the front page of the site, nor does it affect the order when displayed on the interior pages.
Any sort of ordering will work — manual or date. It’s just that the date isn’t having an effect.
Unfortunately, the web site is being developed behind a firewall with no outside access. However, I am very technical and can perform any action required, including updates to MySQL tables as needed. What’s the query and ORDER BY that you’re using for this function? What file does that live in?
Thanks.February 21, 2014 at 5:58 am #4710RaghavendraModerator
new WP_Query(array(‘post_type’ => $post_type, ‘posts_per_page’ => $post_count))
new WP_Query(array(‘post_type’ => $post_type, ‘posts_per_page’ => $post_count, ‘order’ => ‘ASC’, ‘orderby’ => ‘menu_order’))
Depending on the shortcode you are using, you need to change the code accordingly in the php files.
For [show_portfolio] shortcode (which is probably right in your case if you are using the sample data) –
Edit the line number 143 in the file framework/functions/portfolio-functions.php
For shortcode [show_post_snippets] –
Pls edit the line number 434 of the the file framework/functions/post-functions.php (this shortcode is a generic one for all post types).
In both cases, you will need to change
new WP_Query(array('post_type' => $post_type, 'posts_per_page' => $post_count))
new WP_Query(array('post_type' => $post_type, 'posts_per_page' => $post_count, 'order' => 'ASC', 'orderby' => 'menu_order'))
Then you can specify the order in the order attribute that shows up in the portfolio edit page (they also show up when you do a quick edit in portfolio page). Even better, install the plugin
to make it lot faster/easier.
If you need the order to take effect in independent portfolio pages too, pls make similar change to loop-portfolio.php file in the $args variable.
- The forum ‘Agile Theme Support’ is closed to new topics and replies.