4
votes
1answer
93 views

Inject post (from specific category) between posts in Loop

I would like to add a post (from specific category) between posts in the WordPress Loop (such as 'Sponsors'). Example: P P P S P P S P P S P P How can I achieve this? I am a beginner with coding, so ...
0
votes
1answer
35 views

Have posts that belong to multiple categories, exclude some categories from homepage

So I have categories A, B, C and D. And also categories 1, 2, 3 and 4. I have posts that can belong to any four of these categories. But I want to exclude anything in categories B, 4 and D from the ...
0
votes
1answer
22 views

Category nicename inside loop in wordpress

How can I echo the current post's category nicename inside main loop. <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> echo <div class="btn category-nicename"> ...
0
votes
2answers
54 views

How to get all unique categories for posts in loop?

I'm looking to get a plain list of the unique categories in a custom loop (only categories for the posts in the loop). I've been fumbling with some code for a bit and here's what I've got: <?php ...
1
vote
0answers
42 views

Divide Loop Into Days & Categories

If you could help, I'd greatly appreciate it, because I'm halfway there, but I'm currently stuck! The site I'm working on needs to have it's posts, within the loop, divided up by days, and then under ...
0
votes
1answer
47 views

Display page of custom posts?

I have a custom post type, "design_asset". I am displaying them on a page template, with the loop <?php rewind_posts(); $paged = ( get_query_var( 'paged' ) ) ? get_query_var('paged') : 1; $args = ...
0
votes
1answer
62 views

IF have_posts contains posts from a certain category

This issue is now finally resolved by myself. Find the solution in the end of this post. Question was in short: How can i ask in my WP template, IF the whole array of have_posts contains any post from ...
0
votes
0answers
72 views

How to show related posts by category or custom post type?

I'm looking for the best way to go about creating, probably, custom post type where you can filter in the categories related to that custom post type in the sidebar. Here is the website I'm working ...
0
votes
0answers
33 views

Calling Custom Fields within a category loop?

What I'm trying to do is to display a specific category post listing within a page template, showing only each post's custom fields, which must be pulled and included within the following html. What I ...
0
votes
1answer
71 views

Loop through posts of CatA and store value of CatB in separate array

Custom post type "Wines" has two categories: Regions & Producers. "Wines" has a value for both a Region and a Producer. I want to loop through posts in [Category => Region, Term => X] and get ...
0
votes
0answers
74 views

How to add an empty entry to masonry?

I am using masonry js library for display posts in my wp installation. The problem with it is that you cannot really add anything between posts entries because absolute positioning is used. So either ...
0
votes
0answers
110 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
32 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 ...
0
votes
1answer
148 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
52 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
130 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
146 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
398 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
30 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
77 views

Problem with multiple loops in wordpress theme

I am using multiple 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
129 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
162 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
70 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
96 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
19 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
47 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
36 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
140 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
117 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
45 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
57 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
40 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
190 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
102 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
48 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
87 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
27 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
146 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
138 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
53 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
48 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
68 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
1answer
97 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
138 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
694 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
87 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
43 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
57 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
66 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
2answers
293 views

Display post thumbnail for specific category outside the 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 ...