0
votes
1answer
33 views

Exclude parent category when getting category posts by slug

I have the following category layout: Resources -- Documents I want to list the posts in the documents category, and have the following code: $args = array( 'posts_per_page' => ...
-1
votes
1answer
39 views

Can't get Category link inside get_posts

I created a simple function to display the latest posts. Inside the function there is a conditional to display the post category. I found that to display the category name, using $category = ...
-1
votes
1answer
40 views

how to ask if in two categorys inside if

I'm new two wordpress so sorry in advance if this question might be very basic. Depending on which category a post is, I do some script things and I ask inside the loop in this way: <?php if ...
1
vote
0answers
49 views

Posts are not showing up on particular category

On my website, post are not showing up when I navigate to http://www.domain.com/category/category-name/ but on wordpress dashboard, I am able to see the actual number of post under that category. ...
0
votes
1answer
122 views

get_posts ignoring 'category' and displaying all posts

I'm going a bit crazy on this one. I'm trying to display a list of posts in a category on an Admin page in a plugin I am writing. The following code works fine on my dev server (OS X/Apache): $args = ...
0
votes
3answers
87 views

How to show more than 5 posts?

I am running code that shows child categories, and all posts in the child categories. But if there are more than 5 posts in a category, only the 5 newest are shown. How can I show all, or at least ...
0
votes
2answers
74 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
1answer
95 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
2answers
684 views

Get id of category from drop down menu

Im trying to get the category ID from wp_dropdown_categories();and then pass the ID into a loop to have it output posts titles from that particular category. I currently have this: <form ...
0
votes
1answer
44 views

Exclude categories from homepage not longer working

I was using query for excluding categories from my homepage without problems until this week. I'd like to know the reason of the change and a better way to get this. I was trying also diverse ...
0
votes
1answer
198 views

Can't pull posts of a Custom Post Type based on the custom taxonomy of the CPT

My question is about retrieving custom post types via get_posts, when custom post types also have a custom taxonomy. I can use get_posts to retrieve all posts of a custom post type, but when I attempt ...
1
vote
1answer
179 views

Get mixed category random posts

I have 3 categories: A, B, C. A is having around 1000 posts, B has around 300 posts and C has 50 posts. When I query for 5 posts, ordered randomly. I get mostly posts from A category. How can get ...
0
votes
2answers
79 views

4 posts per page from single category

I've been trying to display posts that I've categorized as "news-categories". My goal is to only display 4 posts on sidebar of "cbs-news" slug underneath "news-categories" category. By below mention ...
0
votes
1answer
124 views

Get posts from 2 different categories

I have a custom post (it's called "ait-dir-items") and 2 categories there. On category archive page, I need to get posts which belong to 2 categories. get posts from 2 categories Codition. ...
0
votes
2answers
276 views

get posts from 2 categories. (2 posts)

I have a custom post (it's called "items") and 2 categories there. 1. on category page, I need to get posts which belong to 2 categories. get posts from category1="Food" and category2="featured" How ...
1
vote
2answers
52 views

is there a better way of combining this?

Hoping someone can point me in the direction of writing this in a more succinct way. I'm working on my website, and want to display a total of 5 posts from the category 'general wonderings'. The ...
0
votes
1answer
2k views

List all posts in a category with query_post() function

I'm a C programmer, konw little about PHP. I built a Blog with wordpress. Yestoday, I try to create the page www.abc.com/server, this page would list all posts which belong to server category. I ...
0
votes
1answer
207 views

Showing posts from 2 categories only on category.php

got myself in a bit of a pickle. I want to display posts on category.php from the categories 'latest news' and 'custom models' only. The other category, 'press releases' is shown in a separate column. ...
0
votes
1answer
460 views

Show last post from multiple categories using wp_list_categories

I have the following code that lists out the children categories on a separate page when you click on its parent category. The code renders a list like so: Home › Archive for IQ Issue 7 Journal ...
1
vote
1answer
304 views

Show recent posts from one category on a non-WP site

I'm trying to move back to WP for our blog, after struggling with a clunky CMS for a few years, but we'll be sticking with that CMS for the rest of the site. Is there a plugin (or code) that I can use ...
0
votes
1answer
178 views

not empty categories don't show in menu [closed]

I'm trying to resolve a problem i have showing category posts. I have added a category to my main menu, eventhough it has posts - in the basic theme it doesn't show, in my theme - it shows as a link ...
0
votes
1answer
48 views

How to pull a list of posts in a category while exluding posts in subcategories of the category

I'm using a get_posts() call to pull a list of posts in a specific category. However, the recordset also includes posts in subcategories of the target category. How can I exclude subcategories from ...
0
votes
1answer
2k views

Query only Posts from Both of Two Category?

I have 3 categories, 1.OnGoing projects(cat id='5') 2.Completed Projects(cat id='6') 3.Upcoming Projects(cat id='7') and also i have another 2 categories:(Not a Sub Category) chennai (cat ...
1
vote
1answer
9k views

How to show related posts by category

In my gallery site i want to show other pictures under the current picture (in single post). I seen more codes but it i asks to specify the category, but i dont want want specify the category manually ...
0
votes
1answer
2k views

how to call the category of the post

I jus want to create a gallery which shows either all or certain number of posts in that category under each post and i found a working code <?php $displayposts = new WP_Query(); //get posts ...
1
vote
1answer
1k views

Get_Posts and multiple categories

I have created a custom query in hopes of showing the top posts from some child categories. It appears here: http://www.sitesofconscience.org/activities/whats-new The query has a big flaw: some posts ...
0
votes
1answer
908 views

get all categories' latest post in one query

My WP blog has 12 categories, 80 subcategories. I need to fetch the latest post from each of those 12 categories. I know how to do it in 12 queries using 12 get_posts() but is there a way to get ...
0
votes
2answers
3k views

exclude category from get_posts?

getting posts by cat with get_posts but need to exclude another cat called london or id 10. is this possible? best, Dc. // array(7,-10) $laargsM = array('category' => 7, ...
0
votes
1answer
2k views

Newbie Question: How to create a “latest news” page showing a list of posts from blog category

I am using the Modest theme from elegant themes at http://lilsaintz.co.nz Under the slider on the homepage, there are three content areas that are generated from pages. I would like to make one of ...
0
votes
1answer
384 views

Load the last post of a category

I would like to load the last post when I go to the selected category. For example if I go to http://site.com/category it loads http://site.com/category/35/this-is-the-last-post Does exist some ...
1
vote
2answers
1k views

Trying to only display 1 category using get_posts

I'm trying to only display posts from a certain category in a widget. I've tried it in a few different ways but it is still showing posts from all categories. Here's my code at the moment: $posts = ...
0
votes
1answer
185 views

How to create a custom loop ordered by Categories on a Page Template?

Ex. Category 1 Post 1 Post 2 Post 3 Post .... Category 2 Post 1 Post 2 Post 3 Post .... Category .... Post 1 Post 2 Post 3 Post ....