qsz
Forum Replies Created
-
Forum: Plugins
In reply to: [W3 Total Cache] Page Expiry — can’t seem to change it from 1 hourIt seems that I do also faced that problem here, and I tried to change garbage collection time, in a few hours I’ll reply with results. In my case the problem is that something influence on page cache and renames files in page_enhanced folder from “html” to “html.old”…
Forum: Themes and Templates
In reply to: [Customizr] Posts order byThanks, but I’m beginner and cannot find the file in Customizr theme which I should change.
Is it index.php?
If yes, should I paste the code before?
<?php do_action ('__before_loop');##hooks the heading of the list of post : archive, search... ?>If not, can you tell which file I should edit?
Forum: Fixing WordPress
In reply to: Double Ordering (meta_value_num and title)Thanks, but it does not work.
I checked functions.php and find there this code for taxonomiesfunction my_post_queries( $query ) { // not an admin page and is the main query if ( !is_admin() && $query->is_main_query() ) { if ( is_category() || is_tax() ) { $query->set( 'orderby', 'meta_value_num' ); $query->set( 'meta_key', '_ss_views' ); } } } add_action( 'pre_get_posts', 'my_post_queries' );Maybe adding some changes here may help?
P.s. i need order by meta_value_num (desc) and by title (asc) in categories.Forum: Fixing WordPress
In reply to: Double Ordering (meta_value_num and title)Okay I write
function mam_posts_orderby ($orderby) { global $mam_global_orderby; if ($mam_global_orderby) $orderby = $mam_global_orderby; return $orderby; } add_filter('posts_orderby','mam_posts_orderby');in themes functions.php, but I think I done smth wrong in next code.
Code:// Setup and run the query for getting the list of posts to show $args = array( 'posts_per_page' => 500, 'post_type' => 'product', 'orderby' => 'meta_value_num title', 'meta_key' => '_ss_views', 'order' => 'DESC', 'ignore_sticky_posts' => 1 ); // Add the filter here to get only those // within the setting of how far back // to check. add_filter( 'posts_where', 'within_set_limit' ); $mam_global_orderby = "$wpdb->postmeta.meta_value+0 DESC, $wpdb->posts.post_title ASC"; $posts_in_range = new WP_Query( $args ); $mam_global_orderby = ''; // Clear the filterCan you help me please?
Forum: Fixing WordPress
In reply to: Double Ordering (meta_value_num and title)You can do what you want using filters similar to those shown in this article: http://wordpress.mcdspot.com/2013/01/25/sort-on-presence-of-custom-field-field-value-then-date/
Thank you very much, but can you explain what exact code should I write in order to order posts by meta_value_num and title?
Forum: Fixing WordPress
In reply to: Facebook share not showing Featured ImageInstall Open Graph plugin which support All in One Seo Pack.
And configure it.
I use it and it works perfectly.Forum: Fixing WordPress
In reply to: Facebook share not showing Featured ImageTry to use opengraph
Forum: Fixing WordPress
In reply to: Order posts in category and taxonomy pageThank you very much!!!
Forum: Fixing WordPress
In reply to: Order posts in category and taxonomy pageThank you. What if I use ‘orderby’ ‘meta_value’ and where I should put ‘meta_key’?
function my_post_queries( $query ) { // not an admin page and is the main query if ( !is_admin() && $query->is_main_query() ) { if ( is_category() || is_tax() ) { $query->set( 'orderby', 'meta_value' ); $query->set( 'meta_key', 'price' ); } } } add_action( 'pre_get_posts', 'my_post_queries' );Forum: Fixing WordPress
In reply to: Order post by likes (from tw, fb, g )Yes surely, but it does not work.
Moreover I don’t understand where to put the code in header.php