sia77
Forum Replies Created
-
Forum: Plugins
In reply to: [WordPress Infinite Scroll - Ajax Load More] order by meta value and date…Ok. So the solution to my problem to handle the following shortcode was:
[ajax_load_more post_type="post, article, event, resource, service, team_member" order="ASC:DESC" meta_key="post_weight" orderby="meta_value_num:date" exclude="673"]
I added the following to ajax-load-more.php
if(!empty($orderby) && !empty($order) ){ $orderbys = explode(":", $orderby); $orders = explode(":", $order); $args['orderby'] = alm_get_orderby_query($orderbys, $orders); }
and I added the following to function.php of ajax load more plugin:
function alm_get_orderby_query($orderbys, $orders){ $temp_arr = array(); for($i=0; $i<count($orderbys);$i++){ $temp_arr[$orderbys[$i]]= $orders[$i]; } return $temp_arr; }
Obviously this can be expanded to address a more general concern.
Forum: Plugins
In reply to: [Posts in Page] sorting by meta_key such as event dateSo the answer is yes, as long orderby=”meta_value”, and the date follows the following format yyyy-mm-dd…
Forum: Plugins
In reply to: [WordPress Infinite Scroll - Ajax Load More] order by meta value and date…I just did this, and I think it worked:
[ajax_load_more post_type=”post, article, event, resource, service, team_member” order=”ASC,DESC” meta_key=”post_weight” orderby=”meta_value_num,date” exclude=”673″]
I still want to make sure this is not a happy coincident, so if you confirm, that would be appreciated.
Forum: Plugins
In reply to: [WordPress Infinite Scroll - Ajax Load More] order by meta value and date…Hi DCooney,
Here is what I have now, and it works fine, and sorts by meta_key.
[ajax_load_more post_type="post" order="ASC" meta_key="post_weight" orderby="meta_value_num" exclude="673"]
Here is the problem: I would like to be also able to sort by WP’s post/publish date at the same time as follows:
1. Sorting by meta_values for post_weight (meta_key) takes precedence
2. When the meta_values for post_weight are the same then sort by date in DESC order….Example:
'meta_query' => array( array('key' =>'post_weight', 'type' => 'numeric') ),array('meta_value_num'=>'ASC','date'=>'DESC'),
Could you confirm if the plugin can handle that? If yes, could you let me know how to set-up the shortcode…
Forum: Plugins
In reply to: [WordPress Infinite Scroll - Ajax Load More] order by meta value and date…Let me ask you a question. Is it possible to create a short code where you one can specify the following:
sort meta_value_num in ascending order
sort date in descending orderForum: Plugins
In reply to: [Posts in Page] Excluding a post by IDSo basically, add the first code snippet, and set ignore_sticky_posts to true in the shortcode, so you don’t have to comment out the second code snippet.
In my case, I had to use two short code to get what I wanted….Forum: Plugins
In reply to: [Posts in Page] Excluding a post by IDI figured what my problem was. It’s working now.
Forum: Plugins
In reply to: [WordPress Infinite Scroll - Ajax Load More] order by meta valueThank you.
Forum: Plugins
In reply to: [WordPress Infinite Scroll - Ajax Load More] undo filterdata-order=”ASC” data-orderby=”meta_value_num” data-post-type=”post, article, event, resource, service, team_member”
So I did as above, and it works beautifully, but here is a question:
It appears that even though I’m sorting by “meta_value_num”, it also sorts by date in DEC order. If I’m correct about that, then I would like to know how is that possible. Please let me know.Thanks,
Sia77Forum: Plugins
In reply to: [WordPress Infinite Scroll - Ajax Load More] undo filterI just realized it won’t let me post code, trying again.
data-repeater=”default” data-category=”” data-post-type=”” data-posts-per-page=”8″ data-scroll=”true” data-button-label=”View More”
Forum: Plugins
In reply to: [WordPress Infinite Scroll - Ajax Load More] undo filterNot sure, if it does.
It undoes the filtering, but post are not showing in the same order as the original list (When the page is loaded the first time).
On the back-end, I’m sorting by what we call the post_weight, and then by date. So the way, I understand it if I still want to end up with the same order after undoing the filtering, I would need a way of indicating the sorting criteria, and values, am I correct on this?
Forum: Plugins
In reply to: [Duplicate Comment Authors] Filtering by tagsI figured it out. I was not using slug. It should be always lower case, and with a – in between words.
Forum: Plugins
In reply to: [WordPress Infinite Scroll - Ajax Load More] Embedded video doesn't show upYou are absolutely correct. This has something to do with how the_content() works Vs apply_filters(‘the_content’, $content), and how the latter doesn’t let WordPress do its magic.
Thanks for taking the time on this.
Forum: Plugins
In reply to: [WordPress Infinite Scroll - Ajax Load More] Embedded video doesn't show upIt’s an ajax call. And the response is generated by:
$content = $content_post->post_content;
$content = apply_filters(‘the_content’, $content);
$content = str_replace(‘]]>’, ‘]]>’, $content);So I think I’m using the_content(). The thing is that I’m seeing the link to the video, but the link is not being rendered as a embeded video.
I took that third line out, just in case, and there was no difference.Forum: Plugins
In reply to: [WordPress Infinite Scroll - Ajax Load More] Embedded video doesn't show upNo, we are not using any plugins. That’s strange.