Retrieve post data via WPDB class
Retrieve post data via WPDB class
Retrieve post data via WPDB class
Got the answer, encase anyone else needs it, here it is. <?php $currauthor_id = get_the_author_meta(‘ID’); $terms = get_terms(‘your_taxonomy’, array( ‘orderby’ => ‘name’, ‘order’ => ‘ASC’, ‘hide_empty’ => 1, ) ); foreach ( $terms as $term ) { $myquery = new WP_Query( array( ‘author’ => $currauthor_id, ‘post_type’ => ‘post_type_name’, ‘your_taxonomy’ => $term->slug, ‘posts_per_page’ = > -1, … Read more
Your Knowledgebase and Articles CPT slugs are capitalized. This is not allowed – see the codex. (string) (required) Post type. (max. 20 characters, can not contain capital letters or spaces) Change these to all lower case, both in the first parameter of the register_post_type and in the second parameter of the register_taxonomy, and you should … Read more
Custom Post Type and Taxonomy pagination permalink
From what I can understand of your snippet post retrieval is implemented by get_posts($cat_post_args) call and so results are controlled by $cat_post_args arguments. To add post type limitation to it you should add post_type argument to that array. See documentation on get_posts() and WP_Query (used internally and documents available argument more thoroughly).
Replace the 11th line with the code below (untested): $term_list .= ‘<input type=”radio” name=”typ” value=”‘ . $term->slug . ‘”> ‘ . $term->name . ‘ Number of Posts:’. $term->count; It appears that get_terms has a post count return value.
I think something like this you would be best writing yourself. Take a look at: http://www.catalysthomes.co.uk/homes-for-sale/ Properties are loaded into a CPT and I have my own custom search in the sidebar. Of that search its searching a number of things such as taxonomies, custom fields and ordering by date price etc. So how do … Read more
Your code deletes keys from widgets. One of those keys is named ‘class’. When WordPress looks for the ‘class’ key it is missing and PHP reports that. I think you want this: $groups_sidebars = array(); foreach ( retrieve_widgets() as $widget ) { if ( array_key_exists( ‘groups-sidebar’, $widget ) ) $groups_sidebars[] = $widget; } $wp_registered_sidebars = … Read more
Archive Page Pagination not working
Your code cannot work. At first, your endwhile; and endif statements are inside the string. They will be printed and not executed. The correct formatted code should look like this $hotfoodpresent = get_posts( array(‘post_type’ => ‘st_notice’, ‘posts_per_page’ =>-1) ); if ( $hotfoodpresent ) echo ‘<a class=”lbp-inline-link-1 cboxElement” href=”#”></a> <div style=”display: none;”> <div id=”lbp-inline-href-1″ style=”padding:10px; background: … Read more