WP_Query based on multiple metadata comparisons

You could split this into two WP_Querys: $args = array( ‘post_type’ => ‘match_report’, ‘post_status’ => ‘publish’, ‘meta_key’ => ‘report_type’, ‘meta_value’ => ‘cup’, ‘fields’ => ‘ids’ ); $reportsPre = new WP_Query($args); $post_IDs = array(); if(isset($reportsPre->posts) && !empty($reportsPre->posts)){ foreach((array) $reportsPre->posts as $id) { $post_IDs[] = $id; } } $args2 = array( ‘post__in’ => array($post_IDs), ‘meta_query’ => array( … Read more

Infinite Scroll plugin on Ebuy theme

The page that you have mentioned above has the following markup <div id=”content”> <div class=”box ” id=”post-302″></div> <div class=”box ” id=”post-298″></div> <div class=”box lastbox” id=”post-296″></div> <div class=”box ” id=”post-293″></div> <div class=”box ” id=”post-265″></div> <div class=”box lastbox” id=”post-259″> <div id=”navigation”> <div class=”alignleft”><a href=”http://soballer.com/product/accessories/page/2/”>« Older Entries</a></div> <div class=”alignright”></div> <div class=”clear”></div> </div> </div> Try these: content selector — … Read more

Use wp_nav_menu to dynamically generate child menus

My solution uses the Walker_Nav_Menu and a custom class and is mostly hacked together from this post: How do I dynamically populate wp_nav_menu from a custom taxonomy? Solution: //define the custom post type //could use “page” or “post” as well. define(“MENU_CPT”, “action”); //custom function for selecting posts based on a page parent (ne’ term_id) function … Read more

Link Forms on WordPress

You could create a hierarchical custom post type and create a post for each form. Child forms are then set under a parent, their slug or a post meta field connected to the answers of their parent form. When the form is submitted, you use the answer to select the best matching child and the … Read more

menu items toggle and display on screen size reduction

This is most likely the default behavior for Twenty Twelve; responsive for small screens and thus stacking elements on the page, including the contents of your nav, #site-navigation. Let’s looks at the nav section in the default TT theme: <nav id=”site-navigation” class=”main-navigation” role=”navigation”> <h3 class=”menu-toggle”>Menu</h3> <a class=”assistive-text” href=”#content” title=”Skip to content”>Skip to content</a> <div class=”nav-menu”> … Read more