-
AuthorPosts
-
January 9, 2017 at 5:33 pm #731210
Hi,
I’m using the ‘Enfold latest portfolio’ widget to display future events. Therefore it would be nice if the first occurring event would be on top. How can I reverse the order in which the portfolio entries are displayed in the widget?January 11, 2017 at 7:14 pm #732242Hey graphicsplus,
refer to: http://kriesi.at/documentation/enfold/change-the-sort-order-of-portfolio-elements/
Best regards,
AndyJanuary 11, 2017 at 7:34 pm #732253Hi Andy,
I think that works for a portfolio post gird, but it doesn’t seem to affect the WIDGET i’m using in the footer.
January 16, 2017 at 4:30 am #733860Hi,
This is possible but you have to modify one of the parent theme files. Edit the framework > php > class-framework-widgets.php file then look for this code around line 484:
$new_query = array("posts_per_page"=>$count,"post_type"=>$this->avia_post_type);
.. replace it with:
$new_query = array("orderby" => "date", "order" => "ASC", "posts_per_page"=>$count,"post_type"=>$this->avia_post_type);
Best regards,
IsmaelJanuary 23, 2017 at 1:52 pm #737242Hey Ismael,
I gave it a try. The code wasn’t around line 484 though, but I found it in line 967. Changed it there, but it had no effect…
Regards,
JanJanuary 23, 2017 at 1:56 pm #737245Maybe it has something to do with the plugin ‘No Future Posts’ I’m using. it changes the post status from “future” to “publish” so that I can include future dates into the portfolio which I’m using as an event calendar.
- This reply was modified 7 years, 9 months ago by graphicsplus.
January 26, 2017 at 1:44 pm #738904Hi,
Can you please try de-activating the plugin and check if that helps?
If you have not made any changes on the file, you should find it on 484th line – http://i.imgur.com/dqDJthF.pngBest regards,
YigitApril 28, 2017 at 4:53 pm #784701Hi guys,
I’ve been on holiday so wasn’t able to respond to this topic for a while.
I have changed the class-framework-widgets.php file in the parent theme, but didn’t find the code on the 484th line. It was on line 967. I haven’t changed the class-framework-widgets.php file in any other way. I’ve also checked the class-framework-widgets.php file in another website where I’m also using the Enfold theme, which has never had the ‘No Future Posts’ plugin installed and there the code is also on line 967…
If I disable the ‘No Future Posts’ plugin all the entries in the portfolio and in the portfolio widget disappear as they all have future dates (I’m using it as a future event calendar).
This isn’t a critical issue, but it would be nice to be able to tell my client I got it to work. ;)
May 2, 2017 at 5:09 am #786107Hi,
You should be able to find the code around line 484. By the way, you should update the theme to the latest version, 4.0.5.
Best regards,
IsmaelMay 2, 2017 at 9:31 am #786241Hi Ismael,
That’s what you all keep saying to me, but I’m sorry, the code is NOT on line 484, I’ve checked in several installs of Enfold that I’m running (latest version), and everywhere the code is in line 967 as I explained in my last post. Even so I have replaced the code with what you suggest but that has no effect. Even after updating this install to version 4.0.5.
May 3, 2017 at 2:36 am #786831Hi,
Thank you for the update.
There were extra spaces in every other line of the code, which is why you can’t see the correct position. Anyway, we modified the next query to make it work. Please remove browser cache before checking the page.
Best regards,
Ismael3May 3, 2017 at 9:29 am #786982Awesome! Thanks for looking into it Ismael.
May 3, 2017 at 8:28 pm #787373Hi,
Glad we could help!
Please take a moment to review our theme and show your support https://themeforest.net/downloads
To know more about enfold features please check – http://kriesi.at/documentation/enfold/
Thank you for using Enfold :)Best regards,
BasilisJune 30, 2019 at 12:14 pm #1114577Hi
I have tried this for the sorting order of Latest Portfolios Widget, but the order was not affected, it remains descending. Maybe something has changed since 4.0.5?June 30, 2019 at 8:09 pm #1114674Hi parosweb,
Which version are you running?
Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?
Best regards,
VictoriaJuly 1, 2019 at 10:07 am #1114838Hi Victoria
Thanks for the swift reply!
I run version! (4.5.7) with child theme.
You can find a display of latest portfolio here: https://www.parospark.com/on-sunday-2-june-we-invite-you-to-paros-park-for-the-world-environment-day/
I’ve just done a full back-up. Please let me know when you’re done.
Thanks a lot!July 3, 2019 at 1:08 pm #1115468Hi,
Thank you for the update.
The above modification is for the Portfolio Widget, which is different from the Portfolio Grid element. You can actually adjust the order of the items directly from the element’s panel. Edit the Portfolio Grid element, scroll down a bit and you should see the “Order by” and “Display order” settings. Let us know if it works.
Best regards,
IsmaelJuly 3, 2019 at 1:13 pm #1115469Hi,
It’s the order in the portfolio widget, which I would like to reverse.
Thank youJuly 3, 2019 at 2:45 pm #1115484Hey!
My bad. I missed the link to the single portfolio page, so I actually thought you are referring to the portfolio grid elements in the home page. We’d like to edit the widget file, but the Appearance > Editor panel is not accessible. Please enable it or create a new thread and post the FTP details in the private field.
Thank you for the update.
Best regards,
IsmaelJuly 3, 2019 at 2:54 pm #1115486This reply has been marked as private.July 4, 2019 at 7:40 pm #1115864Hi
Did you had the chance to have look?
Thanks a lot
NicolasJuly 5, 2019 at 1:26 pm #1116043Hi,
Sorry for the delay. We modified line 1129 of the same file.
$this->avia_new_query = array("orderby"=>"date", "order" => "ASC", "posts_per_page"=>10,"post_type"=>$this->avia_post_type); //set a custom query here
You can adjust the “orderby” and “order” value if needed.
Let us know if the order is correct.
Best regards,
IsmaelJuly 5, 2019 at 1:48 pm #1116045Hi,
The order is great! But not the category. It’s not filtering any.
Needs to be hard coded as well?
Regards
NicolasJuly 5, 2019 at 3:42 pm #1116056Hey!
Yes, that might be necessary because there is no filter available to adjust the query, and we can’t use the pre_get_posts hook to alter it.
Try to include the tax_query parameter in the query.
$this->avia_new_query = array("orderby"=>"date", "order" => "ASC", "posts_per_page"=>10,"post_type"=>$this->avia_post_type, 'tax_query' => array( array( 'taxonomy' => $this->avia_term, 'field' => 'id', 'terms' => explode(',', '1,2,3,4'), 'operator' => 'IN') )); //set a custom query here
`
Replace ‘1,2,3,4’ with the actual ids of the portfolio categories.
Best regards,
IsmaelJuly 5, 2019 at 4:12 pm #1116060Thanks.!
It’s working as wanted.
I’ll need to remember to edit the file on the next update.
NicolasJuly 6, 2019 at 7:36 pm #1116319 -
AuthorPosts
- You must be logged in to reply to this topic.