-1
votes
1answer
17 views

List posts related to category on a div [on hold]

i want to display posts related to selected category at the same page(on a different div). What i want is as the image attached, when i click the category name on the left side, all related posts must ...
0
votes
0answers
18 views

Only show top level posts of specific category

I've been trying to create a loop that will only show the top level posts no children/sub category posts. Basically what my categories look like are -- -All --one --- A --- B -- ...
0
votes
1answer
25 views

Query seems to be duplicated

I'm just hit a development brick wall and can't seem to find a solution to this problem. I've running two WP_Query's the aim is one displays premium stockists and the other one displays the none ...
0
votes
0answers
18 views

Querying Multiple Categories With Different Offsets

On my website I have a "Breaking News" section which shows the most recent 4 stories in the "Breaking News" Category. Under this I have a featured news section which displays 5 more stories from the ...
1
vote
0answers
71 views

How to get latest posts from each category in regular order

let's say I have a main query and it displays posts from Movies and Music categories. I want the query to show always 5 latest posts from Movies and 5 latest posts from Music category. When I create a ...
0
votes
1answer
46 views

Show multiple categories in query using redux framework variable

Stuck on trying call an option variable using the Redux Framework - that is utilizing multi-category select - inside the query. Here's what I have as my query: $the_query = new WP_Query(array( ...
1
vote
2answers
72 views

Display Posts of a Category in Alphabetical Order (Custom Post Type)

I have a custom post type called "link" I have a custom taxonomy for this post type called "link-category" I have a template file for this taxonomy, "taxonomy-link-category.php" I need the template ...
0
votes
1answer
50 views

Show custom post type filtered by category

I would like to have a custom post type which contain several sliders for showing in each category page (exact category.php), one for each as planned. All sliders were assigned to related category. ...
-1
votes
1answer
144 views

How to query posts from specific authors and categories using WP_query?

I currently have a WP_query where I am getting posts from a specific set of authors. To this, I want to add specific categories as well. $args = array( 'author__in' => $authors, 'posts_per_page' ...
0
votes
1answer
60 views

Wordpress Numeric Pagination with Query String [duplicate]

So I have a dynamic loop which is affected by a query sting in the URL.. For example I have 3 categories and when they click the category it just adds a query to the URL: <a ...
0
votes
1answer
37 views

Are term_taxonomy_id and term_id the same?

I have a custom query where I need a JOIN because I want to COUNT all the posts of a specific category. So I checked the tables and I found out that table wp_term_relationships contains a reference ...
0
votes
3answers
151 views

How to get posts from two categories with WP_Query?

I'm using WP_Query to create 'latest posts' & 'popular posts' sections on my home page. I'm trying to just pull 5 posts from 2 categories (9 & 11) but it will only show posts from cat 9. ...
0
votes
2answers
54 views

WP_Query of Category Not Showing First Post

I have the following loop, and only this loop, in my home.php file (apologies if I didn't paste the code properly). I have populated lorem ipsum posts, and noticed that of the five posts only four ...
0
votes
1answer
60 views

Custom WP_Query for current category (in category.php)?

I'm using a small code to display a tag list for the current categories like below: <?php $custom_query = new WP_Query('posts_per_page=-1&category_name=overnachten'); if ...
0
votes
1answer
39 views

Return category posts with WP_Query

I have a some categories and want to get the posts with those categories: $temp = $wp_query; // assign ordinal query to temp variable for later use $wp_query = null; $wp_query = new ...
0
votes
2answers
33 views

How to properly use Categories with Custom Post Types

I'm really struggling with this... I created a few Custom Post Types, let's say... Books CD's Maps Now I also have a whole bunch of existing categories and some of these would apply to more than ...
0
votes
0answers
84 views

Get sub categories and posts with the same parent category

I want to fetch all posts in category 1, then fetch all sub-categories in category 1, then merge the results into one array. Is that possible?
0
votes
1answer
75 views

Order posts by separate menu order for different sub-categories

My scenario is as follows: Categories: 1. Category A - Sub-Category A1 - Sub-Category A2 - Sub-Category A3 2. Category B - Sub-Category B1 3. Category C 4. Category D The ...
0
votes
0answers
132 views

Display newest posts from multiple categories ordered by date

I have the categories listed below in my post post type. Category Name: Test 1 ID: 1 Category Name: Test 2 ID: 2 Category Name: Test 3 ID: 3 Category Name: Test 4 ID: 4 I'd like to retrieve for ...
0
votes
1answer
53 views

Retrieve latest post by multiple categories with ID

I have the categories listed below in my product post type. Category Name: Test 1 ID: 82 Category Name: Test 2 ID: 83 Category Name: Test 3 ID: 84 Category Name: Test 4 ID: 85 Now I want to ...
0
votes
0answers
105 views

category_name not working in WP_Query

I have a custom post type and I wanted to show posts just from a certain category but its not working. Here is the code: <?php // Reset post data. wp_reset_postdata(); $photo_group = 0; // For ...
0
votes
1answer
143 views

Using in 'category_name' in '$query->set();'?

Here's the function I have in my theme's functions.php: function better_editions( $query ) { // Categories act as 'Editions' on my site $get_edition = get_query_var( 'category_name' ); ...
0
votes
0answers
26 views

WordPress | WP_query with multiple category starting to show with a specific category

How I can show a WP_query result posts starting to show a query by a specific taxonomy and than all the others? I have thought to a UNION in the query, but I would something with the WP_query loop. ...
0
votes
2answers
76 views

Set colors depending on category

I have this function which outputs the last 6 posts of categories 1 and 2. <ul> <?php query_posts('cat=1,2&showposts=6'); ?> <?php if ( have_posts() ) while ( have_posts() ) : ...
0
votes
0answers
38 views

Custom list of categories that is sortable by count

So I am attempting to use bootstrap with wordpress. Inside my left column my design called for a large box and then 4 smaller ones below. Those boxes would hold information about a category. There ...
0
votes
1answer
113 views

Exclude most recent posts from specific category in wp_query()

I have a featured posts slider, which uses the 'featured' tag. I have a query for this which grabs the 3 most recent posts with this tag and shows them in the slider. Below this, I have a list of 10 ...
0
votes
1answer
111 views

multiple values in an array for category__and does not work with WP_Query

So I'm looping with WP_Query and here is my code: $country_posts = new WP_Query(get_direct_children($continent_cats)); if ($country_posts->have_posts()) : while ($country_posts->have_posts()) ...
0
votes
1answer
58 views

Printing direct descendants of a category with WP_Query

So I'm having trouble printing just the direct children of a category on a page. Here's my code: $category_id = get_cat_ID('destinations'); $args = array('child_of' => $category_id); ...
0
votes
2answers
78 views

Make assigning post to a specific category equivalent to assigning it to all categories

Allow me to explain with an example, for the sake of clarity. Please take the time to read it all to get a good idea of what I am exactly after. On my WordPress site categories are used as Editions ...
1
vote
2answers
45 views

Querying Term Posts in Loop

I'm trying to show my CPT Category along with any posts associated with it below the title. I have the first loop fine: <?php $cats = get_categories(array('taxonomy' => 'custtax', 'orderby' ...
0
votes
1answer
71 views

Custom Page Template Category loop not functioning correctly

So after several attempts to correct this - It seems the pages not load but don't pull in the correct posts from each category. It just seems to pull in the same default posts whenever I click each ...
0
votes
1answer
97 views

Custom Category Page Not Working [duplicate]

Under "Settings" => "Reading", I have set "Blog pages show at most" to 6. I have created a category called 1970s where one can see all the best Rock albums of the decade -> Meanwhile, I have created ...
0
votes
0answers
67 views

Build Categories List for Posts with specific meta_value

I've a set of Posts under custom post type that has a specific custom field (meta_value). This posts are categorized with a simple Common Parent->Child#N relationship. The question is how to list ...
1
vote
0answers
38 views

How to show in search results posts with a particular tag in a particular category?

As the home page of my blog I've a static page. There I want to show the navigation of the site. Category1 Sub-Category1 tag1, tag2, tag3 Category1 Sub-Category2 tag1, tag2, tag3 ...
0
votes
1answer
38 views

How to Include a common category in a custom Category Search

I was wondering how to solve this issue. This is my Query: $query = new WP_Query( array( 'posts_per_page' => 6, 'orderby' => 'date', 'order' => 'DESC', 'category__not_in' ...
0
votes
1answer
43 views

Retrieve post tags from from main wp_query

I'm running a custom WP_Query and find the following SQL running as part of it. SELECT t.*, tt.*, tr.object_id FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON tt.term_id = t.term_id INNER ...
-1
votes
1answer
125 views

Narrow Down a Shop Page Results Based on a Product Tag in WooCommerce

I have a shop page that displays a product (chairs) for a retailer in multiple cities. Each city is a tag for each product. What I want to be able to do is narrow down a category page like (chairs) or ...
0
votes
1answer
736 views

Custom query with category exclusion and post-meta “whitelist”

I have two widgets, one shows News while the other shows everything except News (We'll call the second one Blog). The blog portion is currently working correctly. The News posts are either ...
1
vote
1answer
532 views

Combine two taxonomies in a hierarchical tree

For example, I have WooCommerce products that have taxonomies: brand (e.g. Converse, adidas, D&G) (taxonomy id: product_brand) category (e.g. Boots, Sneakers, Sandals, Heels) (taxonomy id: ...
1
vote
2answers
126 views

Trying to find a way to query post like normal search would do. within search.php page

I have a costume search in a site i am making. When a user search a certain term, i want to display category list with a count of how many posts are found with in that category. I thought of a way ...
0
votes
1answer
75 views

Display posts from a category

I am trying to display a bunch of posts from a single category on the category page, using multiple loops. <div id="featured-content" class="clearfix"> <? // assign the variable as current ...
0
votes
1answer
155 views

WP_query exclude a category unless it has more then one catagory

I have this category exclude_cat with id 39 I want to exclude it from the home. So I use for WP_Query args like this: $args = array ( 'category__not_in' => array( 39 ), //exclude ID ); Works. ...
0
votes
1answer
339 views

Posts of specific category on page and excluded from index.htm

hope things are going well. I'm trying to create a member's only section specific for posts of about job opportunities. My goal is to have posts of this category displayed on this page and excluded ...
0
votes
1answer
228 views

Custom loop of a single category, cannot order by date. What am I missing?

I'm going nuts. All I have is a simple loop on the home page of the site (which is a static page), and it should show the most recent (1) post of a certain category. The trouble is no matter what i ...
0
votes
1answer
528 views

WP the_posts() on single-cars.php get category link

I have a custom post type called cars. There is a taxonomy brands. I have a template single-cars.php and I'd like to add a link to the brand page(The category). Assume I'm on the page of the post ...
0
votes
3answers
153 views

Show only one category in main query, issues on tag page

I altered the following code from Ashfame: add_action('pre_get_posts', 'block_cat_query' ); function block_cat_query() { global $wp_query; if( is_home() || is_search() || is_tag() ) { ...
0
votes
1answer
310 views

new WP_Query issues

My default wordpress set hold 10 posts per page. In category.php , I want to override this with 999 post per page, the problem is that isn't working at all. When I use the following code. it ...
-1
votes
1answer
21 views

Are custom posts included when getting a categories' posts?

Would WP_Query('cat=1') display custom post types, or is that something that I have to specify? I have a custom post type, am assigning it to a category, and would like for it to be displayed when ...
0
votes
1answer
601 views

Pagination on category.php and tag.php not working

i'm using a query-loop on my template pages like this: <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $wp_query = new WP_Query(); ...
0
votes
1answer
147 views

WP_Query: Fetch posts that are in (category1 and not in category2), OR posts that are not in cagegory1

I have two categories that will always stay the same. They are called "Events" and "Show on frontpage". The latter is a child category to Events. What i want to do is, when fetching posts (using ...