Sorting by date not working?
Sorting by date not working?
Sorting by date not working?
You can either sort them with jQuery on the front-end, or pull the like count into the back-end and store on the post_meta. Then sort by meta value in your loop. FACEBOOK http://graph.facebook.com/?id=http://{URL} Result { “id”: “http://{URL}”, “shares”: intgr/(number) } Other types of share counts.
MySQL does not do “natural” sorting natively, though there are attempts to make it work. I have no idea how that plugin you mention works but sorting by menu_order with a post_title fallback is trivial. add_action( ‘pre_get_posts’, function ($qry) { if ($qry->is_main_query()) { $qry->set(‘orderby’,’menu_order title’); } } ); Of course, that gets menu_order equal 0 … Read more
I edited the wp_playlist_shortcode function at \wp-includes\media.php WP core file, by adding if ($atts[‘orderby’]==’excerpt’ || $atts[‘orderby’]==’post_excerpt’) { function cmp($a, $b) { return strcmp($a[“caption”], $b[“caption”])*(-1); } usort($tracks, “cmp”); } before $data[‘tracks’] = $tracks; line. Basically after all tracks are generated into the $tracks array and before this array is passed to the final array $data, I … Read more
<td class=”order-number” width=”1%”> <a href=”https://wordpress.stackexchange.com/questions/190318/<?php echo wc_get_endpoint_url(“view-order’, $order->id, wc_get_page_permalink( ‘myaccount’ ) ); ?>”> <?php echo $order->get_order_number(); ?></a> </td>; this should solve your problem. But I am not sure which template your are modifying, but fool proof way is only possible with child theme (functionality plugin will be complex for your needs). https://support.woothemes.com/hc/en-us/articles/203105897-How-to-set-up-and-use-a-child-theme http://docs.woothemes.com/document/template-structure/ both of … Read more
I find it: add_action( ‘admin_init’, ‘posts_order’ ); function posts_order() { add_post_type_support( ‘post’, ‘page-attributes’ ); }
have_posts() is just a function that returns boolean value. You can use WP_QUERY instead and use order argument for ordering the posts.
Use jQuery on your page to sort the divs. Ideally you want your divs to all have the same CLASS so you can identify which divs to randomize. I’m not familiar with the thesis theme but presumably there is a testimonials.php or something similar you could modify. If so, add your jQuery in there. Here’s … Read more
Try WP_Query() instead of query_posts() $args = array( ‘posts_per_page’ => 10, ‘meta_key’ => ‘t_count’, ‘orderby’ => ‘meta_value_num’, ‘order’ => ‘ASC’ ); // The Query $the_query = new WP_Query( $args ); // The Loop while ( $the_query->have_posts() ) : $the_query->the_post(); echo ‘<li>’ . get_the_title() . ‘</li>’; endwhile; // Restore original Query & Post Data wp_reset_query(); wp_reset_postdata(); … Read more
after a lot of trial and error WP transients came to save me!! here is the solution for anyone that might need this… in the index.php (outside the main loop) i save the current random order in a transient: $order_array = array(); while ( $the_query->have_posts() ) : $the_query->the_post(); $order_array[] = get_the_ID() ; endwhile; set_transient(‘post_order’, $order_array, … Read more