get_posts() is a function for creating multiple loops. It retrieves a list of latest posts or posts matching criteria.

learn more… | top users | synonyms

-1
votes
1answer
160 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
votes
2answers
47 views

query_posts works while get_posts doesn't

I try to create a page that shows my posts (a page different than the "posts page" defined in wp-admin). When I copy my index.php into this new page and add <?php ...
-1
votes
3answers
143 views

Custom Post Type meta value is being saved in array, instead of just the string (as value)

So, this is how WordPress is saving my CPT meta: array(8) { ["product_id"]=> array(1) { [0]=> string(10) "abcdefg987" } ["end_date"]=> array(1) { [0]=> string(10) "02-02-2015" } ...
-1
votes
1answer
280 views

Multisite pagination with get_posts

I'm looking for a way to paginate my get_posts : $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array( 'posts_per_page' => 5, ...
-1
votes
1answer
21 views

Intergrate WP into website

I am trying to integrate WordPress into my website. I can pull all the information, except the image. I use the code below: require( 'my-blog/wp-blog-header.php' ); $posts = get_posts( ...
-1
votes
1answer
227 views

tax_query not working properly with get_posts

Here are my args: $args_home = array( 'post_type' => array('news', 'jobs'), 'posts_per_page' => 12, 'meta_query' => array( array( 'key' => '_thumbnail_id' ...
-1
votes
1answer
158 views

Query custom post types by meta field in a term from custom taxonomy

I need to retrieve all custom posts that have terms from custom taxonomy assigned to them. To be more precise: There is advertisers_cats post type that has terms assigned from custom taxonomy ...
-1
votes
2answers
118 views

Latest post on specific category and custom css

I'm trying to create a new home page with two columns for latest post of specific category. This the page code: <div id="left-column"> <div class="bloccorosso">News & ...
-1
votes
1answer
1k views

Display post's description and caption

I am trying to get and display 5 featured posts. To achieve this target I have an offset of 5 recent posts. I have successfully fetched the posts' id's and images, but I failed to get every post's ...
-1
votes
1answer
137 views

show custom post's post in two different divs [duplicate]

I have created a custom post type. For that I have used this code add_action( 'init', 'broker_post_type' ); function broker_post_type() { register_post_type( 'new_broker', array( 'labels' ...
-1
votes
1answer
732 views

posts_per_page - Repeats only first posts 'post__in' array

This question correlates with a previous question I was able to solve here: http://wordpress.stackexchange.com/a/137929/28389 I am using an array for 'post__in', and I am able to run this no problem. ...
-1
votes
1answer
274 views

get posts based on category and post meta

I am coding a Live Show box for a radio website to show who is on air and who is up next. I've been using the get_post function to retrieve posts based on the category (in this case the day of the ...
-1
votes
1answer
823 views

How to show only text from post in WordPress

How do I retrieve just the text of a post in WordPress not including any pictures?
-2
votes
1answer
98 views

append $_GET parameters to post

I try to find a plugin that can "auto insert" to post edit/add page a parameters by fill $get paramerts: for example:post.php?title=a&tags=ss,dds,aa Ideas?
-2
votes
0answers
15 views

Display posts on page template where category matches the page's custom field

I'm attempting to create a page template that displays posts that have a category that matches that page's custom field values. In the page template I have a custom field named "Page Category". If ...
-3
votes
1answer
549 views

Get all posts without tags

I'm working with a tag plugin. Is there a WordPress way to get_posts or query all posts that have no tags? EDIT I had already queried the WP Codex, search Stackexchange and Google for a related ...