0
votes
0answers
17 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 -- ...
1
vote
1answer
17 views

How do I display the posts from a custom post type on a category.php page?

I have set up a category.php according to this wordpress hierarchy diagram. When I am on the page http://example.com/category/my-category I want to display all posts that are under my-category using ...
-1
votes
0answers
35 views

How To Display Categories Conditionally on “The Loop”

I'm trying to get specific categories to display, and only when a given page is displayed. I have tweaked the start of "The Loop" to look as shown below but it doesn't work. Any suggestions on how to ...
0
votes
1answer
45 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( ...
0
votes
0answers
30 views

List all wordpress categories on page loop

I'm trying to build a wordpress theme for a magazine site I plan on launching and I'm kind of stuck on a certain issue. I'm listing my posts in a 3 column layout and I'd like to create a page where I ...
1
vote
2answers
31 views

Display content from custom post type if match to main post category

I solved the problem of displaying from a custom post type in a post with this solution, however, I want to filter even more and only display the posts from custom post type that match the main post's ...
0
votes
1answer
41 views

Get the ID of the current post's child category

A client of mine wants to create a simple "related posts" loop that shows 6 of the most recent posts that match the current post's category. The issue is that every one of their posts have the same ...
0
votes
4answers
73 views

How to exclude categories from recent posts, recent comments & category widgets?

I use the bellow function (thanks to @helgatheviking!) to exclude categories from the wordpress loop. It works very well - posts of selected categories are excluded from the loop on the main blog ...
0
votes
1answer
20 views

filter a loop base on specific category

i am going to filter my loop base on the category the problem is that when i am using the following code it display all my post. // Query args $custom_cat_args = array( 'posts_per_page' => 15, ...
0
votes
1answer
46 views

problem with using serveral loop in wordpress theme

i am using several loops like this <?php $posts = get_posts('numberposts=1&order=DESC&orderby=post_date&category='.get_cat_ID( 'سیاست' )); foreach ($posts as $post) : ...
0
votes
0answers
32 views

post category exclusion in main loop

I have mostly posts from category A. Whereas other categories have very few posts. Due to which my main loop shows posts of category A and other category posts don't get seen much on homepage which ...
0
votes
1answer
58 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
0answers
34 views

Password protected category based attachment/media list?

I am working on building a custom template, and I'm running into some trouble using the password protected feature for wordpress pages. Basically, the content from the page I have published and set ...
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
15 views

Loops in category description

I would like your help to find how to do a thing I need: I have some posts, for example: Article Title: Banana Article Title: Orange Article Title: Lemon Article Title: Strawberry All this ...
0
votes
0answers
44 views

How to get multiple loop in category.php, my scripts becomes madness

I am trying to develop a category.php page for my new theme and the loop which I’ve developed shows all posts of my blog and really bad too. I'm not an expert in WordPress theme development and ...
0
votes
1answer
31 views

Displaying categories items among posts

I'm making a website with lots of custom posts as well as custom hierarchical taxonomies. Default index (archive) page is made of bricks with photo, title and excerpt from posts. And here comes the ...
0
votes
1answer
64 views

Second level subcategory

I'm trying to get anoter level subcategory to show in my select option. I've managed to get one... how can i get the other? <?php $taxonomies = array(CUSTOM_CAT_TYPE); $args = ...
0
votes
1answer
92 views

Tag page only display 10 posts

I've had a problem with this for quite some time now and cannot for the life of me figure it out. I am using Multi-site and not sure if that has anything to do with it or not, so keep that in mind. ...
0
votes
1answer
34 views

why does wordpress ignore the post args?

I dont get it. Straight outa the Codex, <?php // my code $cat = get_the_category(); $catName = $category[0]->cat_name; //straight outa the codex // The Query query_posts( ...
0
votes
2answers
53 views

Several loop in search result

I would like use two loops in the results after a search. First of all, I begin the loop if there is result <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> ...
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
110 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
1answer
34 views

Category slug in in loop always the same?

My post category structure is 3-level deep: Products Milk products Milk Chocolate Cheese I want to show all posts from "Milk products" and add appropriate category slug as class, for example ...
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 ...
0
votes
1answer
24 views

Error trying import one category on page

I'm trying to post on this page only posts from category "Fotos Abertas" but I'm not getting, is showing all categories. Is there any error in the code of my template? <?php /* * Template ...
0
votes
2answers
108 views

display all posts in current category

I am trying to display all the content/posts assigned to a certain category. I have a custom post type set up called 'Videos' and within this I have created categories called music, commercial, promo ...
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
48 views

Show post when both categories are present but not one of them

I'm having issue filtering posts by category. There is the A category for posts (which is the default and also applies when no category has been set explicitly) and B category with subcategories for ...
0
votes
1answer
47 views

how to get number of posts in a category on a specific date

I want to get the number of posts for each category on a specific date. I think I can do the following: - get a list of categories - start loop ---create a query for each category and specific date ...
0
votes
1answer
61 views

how to define category loop last class in the third

on my page category.php file i'm using product listing, product block loop is , product-block , product-block , product-block last last class no margin-left, how to define third product "last ...
0
votes
0answers
30 views

Group category list by other categories excluding some posts

I want to list posts on a category page in a special way. All my posts belong to two categories out of five. The categories are of two "types", the 'w' and the 'k', and a post cannot belong to more ...
0
votes
1answer
51 views

Show posted on date only for posts in a certain category

I am using a lot of custom post types throught my site and don't want to show a "posted on" date on them. I only want date to be shown for the post in "Featured" category. I've made some changes in ...
0
votes
1answer
113 views

2 loops in archive.php (one for each category)

I have a custom post type set up for a news blog on a site I'm building, the custom post type being blog consisting of 2 categories, blog-image-post ID=3 and blog-text-post ID=4. I want to loop each ...
1
vote
1answer
504 views

Filter Select results based on selection

I am trying to filter which job results are rendered to the page whenever the user changes the select item on my form. The select items are dynamically populated by the code below which assigns them a ...
0
votes
1answer
70 views

My Query is getting the wrong data

I am trying to populate a select box to get the categories created in my ACF post type, when clicked these will filter available jobs via their category. The post type can be seen here - Post Type ...
0
votes
0answers
39 views

Detecting top parent category fails on home page

I have the following method to detect a top level category. But it fails on home page returning alway true. //detect parent category function in_parent_category($cats,$_post=null){ foreach ...
0
votes
1answer
52 views

Is there a reason I cannot get the current category in a loop?

I think I am doing this wrong but if I do: if(have_posts()){ $category_id = get_query_var('cat'); var_dump($category_id); while (have_posts()){ the_post(); } } the var dump ...
0
votes
1answer
54 views

Limit Loop to One Category

I am trying to limit my loop to one category. This is the loop: <?php $counter = 1; //start counter $grids = 3; //Grids per row global $query_string; //Need this to make pagination work ...
0
votes
1answer
184 views

display post thumbnail for specific category outside of loop

I'm building a theme that features a section wherein I'd like to have the single most recent post's thumbnail of a single category displayed between the header and blog sections. Something like ...
0
votes
1answer
401 views

List post only under the category, exclude child category content

I wanted to list posts which are directly under a category and not inside the "sub category". In other words, I want to hide all the posts which are from "Sub Category" in the Parent category view. ...
0
votes
1answer
75 views

My custom query not detecting the correct category

For category.php my custom query code isn't displaying the posts from the correct category. I have a parent category called 'Blog' and it can have any number of unknown children. With that in mind ...
0
votes
1answer
88 views

Category archive is displaying all posts rather than the specific category

Here is my loop code for index.php . I do not have an archive or category.php right now. This is very basic. $temp = $wp_query; global $wp_query; $wp_query = new WP_Query(); ...
0
votes
0answers
46 views

Run a query when in last category

Can anyone help? ive searched google but with no luck. currently Accounts has sub categories but no posts /accounts/ = /billing1/ + /finance/ Billing and finance have posts but don't want ...
0
votes
1answer
50 views

Get post category as a separate string and url

I need to figure out how to get post category as a string and link, both separate from each other. So the return would be something like: Uncategorized http://link-to-the-category.com however both ...
0
votes
0answers
125 views

Limit categories appearing in latest feed

I am using ColorLabsProject's 'Reportage' theme ( http://demo.colorlabsproject.com/reportage/ ) as a mobile site and the six categories listed at the bottom of the front page are pulled in ...
0
votes
1answer
118 views

Categories and page filtering with pre_get_posts

I have 3 pages, "Page 1" shows custom post-type "articles", "Page 2" shows custom post-type "tips", and "Page 3" shows both custom post-types. This is done conditionally with a custom loop in ...
0
votes
1answer
79 views

Filter Category Loop Dynamically

I'm trying to display a custom loop with a dynamic category filter. As a setup I have categories of all usernames which are created once a user creates an account. So I am trying to echo the user's ...
0
votes
1answer
52 views

Remove the_content From Loop

I'm trying to display a custom loop with only certain elements in it. My loop currently contains the title, creation date, author & content. However I am trying to remove the content for each ...