Sort Order
-
Hi Jose,
Quick question: Is there anyway to set
@sorting_orderto Random?I have a website with a lot of content but not many updates. So, I wanted to have NLP display a random list of past content. It could either be generated on page load or even refresh after a period of time.
Hope everything is going well and thanks for your help!
-Carl
-
Hey Carl,
There is
randomwhich you could use withsort_by_dateto display posts randomly. Give it a try and let me know if it works for you.Best regards,
Jose SAYAGO.Thanks for this help!
sort_by_date=randomseemed to maintainsort_by_date=TRUEexcept or organized the feed by blog.So, the start of the blog feed is the primary domain’s blog ordered by date. After the primary blog’s posts have ended, it then lists all the post from the first subdomain created by date, and so on. Here are the current settings just in case I made a mistake.
[nlposts number_posts=100 ignore_blog=14 thumbnail=true thumbnail_wh=150x150 thumbnail_class=alignleft instance=placeholder title_only=false display_type=inline-block excerpt_length=30 auto_excerpt=true full_meta=true use_pub_date=true sort_by_date=random posts_per_page=10 paginate=true ]I tried without
use_pub_date=truealso.Let me know if I should try or test anything else.
Thanks for your help as always! 🙂
Hello Carl,
Sorry I wasn’t clear enough, there is a parameter named
randomactually which you can use to randomize posts.Try with these and let me know if you notice something different:
[nlposts number_posts=100 ignore_blog=14 thumbnail=true thumbnail_wh=150x150 thumbnail_class=alignleft instance=placeholder title_only=false display_type=inline-block excerpt_length=30 auto_excerpt=true full_meta=true use_pub_date=true sort_by_date=true random=true posts_per_page=10 paginate=true ]Hi Jose,
No problem at all! I figured it was probably something small.
With
random=true, is there a way to have the order change periodically, so the front page content changes for repeat visitors (i.e. daily, weekly, once a cookie expires, etc.)?Unrelated:
1. I did notice after the last NLP update, the post date information in thespan.nlposts-ulist-metahad been removed.
Older Version: Websitename – Published on March 4, 2015 by Username
New Version: Websitename – Published by UsernameI’m not sure if this is intentional, but I wanted to point it out.
2. A feature idea I wanted to run past you is, dynamically changing the URL when clicking the pagination. When testing out the Ajaxify WordPress plugins compatibility with NLP, the URL was dynamically changing with each page change to: website.com/?pag=2, …/?pag=3, etc. which helped with navigation once a user returned to the home page after reading a post (So, they return to the same list of results instead page 1).
I know you are very busy, so no expectation with the idea, just wanted to share 🙂
Thanks Jose!
All the best,
CarlHi Carl,
Random works every time instances are loaded, so whenever a visitor reloads the page containing an NLP instance, it will load different posts each time.
Regarding the date, indeed there was a change introduced in 3.7, there is now a new feature named
display_datewhich is set tofalseby default. When active it will display post dates along with other metadata. This was introduced due to some inconsistencies in networks where date formats have not been standardized. So to avoid displaying different data formats for every post, I decided to introduce this feature as a quick fix for such cases.However, I plan to include a date format parameter in future releases to allow users to force a custom date format ignoring those set in network’s blogs.
As for your suggestion about the AJAX URLs I totally agree, I will add this as well in future releases. Thanks for the heads up.
Best regards,
Jose
The topic ‘Sort Order’ is closed to new replies.