PDM@WP
Forum Replies Created
Viewing 4 replies - 1 through 4 (of 4 total)
-
Forum: Themes and Templates
In reply to: [Customizr] Child theme's style.css edits not workingHi to All,
Please see:
http://ww.wp.xz.cn/support/topic/child-theme-stylecss-not-overriding-parentWorked for me!
Forum: Plugins
In reply to: [Admin Menu Editor] Contact Form 7Forum: Plugins
In reply to: [Featured Post] Showing non-featured postsUPDATE:You should also update the admin_ajax function. Please see below
function admin_ajax( ) { $post_id = $_POST[ 'post_id' ]; $is_featured = get_post_meta( $post_id, 'featured', true ); $newStatus = $is_featured == 'yes' ? 'no' : 'yes'; delete_post_meta( $post_id, 'featured' ); if ($newStatus=="yes") add_post_meta( $post_id, 'featured', $newStatus ); echo ":P"; die( ); }Forum: Plugins
In reply to: [Featured Post] Showing non-featured postsHi Matthieu,
I am newbie in WP but i had the some problem and locked into the plugin code. I have changed pre_get_posts function and worked for me. Hope this can help.
ps. Sovit thanks for your plugin – it’s very intuitive for the End user
function pre_get_posts( $query ) { if ( !is_admin() ) { if ( $query->get( 'featured' ) == 'yes' ) { $query->set( 'meta_key', 'featured' ); $query->set( 'meta_value', 'yes' ); } else if ( $query->get( 'featured' ) == 'no' ) { $metaquery = array( 'relation' => 'OR', array( 'key' => 'featured', 'value' => 'yes', 'compare' => '!=' ), array( 'key' => 'featured', 'value' => '', 'compare' => 'NOT EXISTS' ) ); $query->set( 'meta_query', $metaquery ); } } return $query; }
Viewing 4 replies - 1 through 4 (of 4 total)