Updating last modified by dynamic content

Is there a way to update the portfolio last modified based on new content added by loopers ?

last modified changed when a new gallery is added by the looper ?

Hello @wicara,

Thanks for writing in!

If you are using the Looper Provider Query String, you can add orderby=modified in your query string.

Hope this helps.

Thanks Ruenel but not quite what I am after, the portfolios are looppers of galleries so I want to add a new gallery and the portfolio order is updated.

each portfolio is a looper of tags for galleries, When I add a new gallery to that tag I want that portfolio to be the top post showing because when I add a new gallery its updating the portfolio.

does that make sense ?

Hey @wicara,

We understand your concerns but we need to check on your setup properly. To do that, please give us the following information in a Secure Note.

  • WordPress Login URL
  • Admin level username and password
  • Page URL or Layout Builder Name

You can find the Secure Note button at the bottom of your posts.

Thank you.

added to this reply

Hello @wicara,

You are using this Looper Provider Query String:
post_type=envira&posts_per_page=-1&post_status=publish&tax_query[0][taxonomy]=client&tax_query[0][field]=slug&tax_query[0][terms]={{dc:p:customer}}&orderby=date&order=DESC

By changing the orderby=date to orderby=modified will mean that the order of the items will be changed according to the modified date.

Hope this makes sense.

this sets the order of the galleries in the portfolio not what I am asking, I am asking to sort to portfolios by last modified and to set the portfiolio last modified when new content is added to the portfolio page via the looper.

in this example when a new gallery with the value of jetts is added then the portfolio for jetts would be the first on the list.

Hello @wicara,

Your “Projects” page which uses the Layout - Portfolio page template will display the latest published gallery items in chronological order. Having to change the order when a particular gallery has been modified will need you to have a custom PHP code in your child theme’s functions.php file that modifies the query var of the said page. This articles might help you instead:

You may need to change the condition from $query->is_main_query() && ! is_admin() && $query->is_home() to $query->is_main_query() && ! is_admin() && $query->is_page('projects').

Be advised that custom PHP is beyond the scope of our support under our Support Policy. If you are unfamiliar with code and resolving potential conflicts, you may select our One service for further assistance.

Best Regards.

one way I was going to overcome this is by updating the modified date, I created the code and went to update the post modified field and it wasnt working so I checked the database.

for the id do I need to add a + 1 to the id to modify the last modifed date ?

I had updated the post data and checked in the database but on the page with no loopers the {{dc:post:modified_date}} is not showing the date that is in the last modified field. Where does it come from is it a custom field for the theme ?

Hello @wicara,

It is best to update it manually by editing the post or portfolio item. Using a custom code may not be helpful and may lead to an issue in the long run.

Be advised that custom CODING is beyond the scope of our support under our Support Policy. If you are unfamiliar with code and resolving potential conflicts, you may select our One service for further assistance.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.