0
votes
0answers
13 views

Why I obtain this WP_Query strange behavior trying to select posts having a specific tag?

I have the following problem with featured tag posts I have a page of a website in wich I want to show only the posts that have setted a specific tag (using the loop). So in this page I have put ...
0
votes
0answers
13 views

Why I have this strange behavior when I try to exlude the featured post from posts visualization?

I am quite new to WordPress theme development and I have a strange behavior with this custom theme on which I am working: http://lnx.asper-eritrea.com/ As you can see in the home page I have 2 areas ...
0
votes
0answers
38 views

Why doesn't my WordPress page show the most recent post?

I was wondering if someone could help me with the following. My news page on my WordPress website doesn't show the most recent blog post, which I want it to do. The code I have is: ...
0
votes
1answer
24 views

Get postlist for each category using query_posts?

<?php $cat_name=array('Breaking News Stories', 'Call-out', 'Featured Story', 'Standard Stories'); $count=count($cat_name); /*Get category_id by its name*/ for($i=0; $i < $count; $i++) { ...
0
votes
1answer
66 views

query post limits

function posts_limit_fn($limit, $query, $custom_limit = ''){ if($custom_limit !== ''){ return $custom_limit; } return $limit; } this piece of code is executed into an AJAX ...
-1
votes
2answers
25 views

How to modify this function to exclude also the post belonging to a specific category?

I am very new in WordPress development and I have the folglowing problem. I use this function (declared into the functions.php file of my theme) to modify the main query in such a way that the post ...
0
votes
1answer
16 views

Saving a post ID to use in a form elsewhere on website

I am trying to save a certain queried post's ID to pass on in a form outside of my loop. To be more specific. I have one file named review.php, this file contains a Wordpress Loop which queries one ...
0
votes
1answer
29 views

How to save posts position on homepage after random function?

I use the following code to display a random post on a homepage: <?php global $query_string; query_posts($query_string . "&orderby=rand"); ?> When the page is refresh posts positions are ...
0
votes
1answer
28 views

Query function not executed between <div> element [closed]

I'm wondering why the following code is not executed between the element it's put in. I know sort of how to fix, but I'm not sure if that's the best solution. My code: First function function ...
0
votes
2answers
17 views

Display an author's posts on his own author page

I have a blog that publish articles of any philosophers.Each philosopher has a special page that includes information about him. I've created a post type called philosopher. I want to display the ...
0
votes
3answers
71 views

Exclude posts from homepage having a specified tag

I am pretty new in WordPress development and I am trying to implement this custom theme that handle the so called featured posts As you can see in the posts area of the homepage I have the Articoli ...
1
vote
3answers
59 views

Can I set and show “important” post in my blog?

I have the following doubt related to the WordPress posts showed in the home page. I know that in the home page I can show the latest published posts. But can I also show (before the latest posts) a ...
0
votes
1answer
43 views

Automatically create a loop for post ID

I am having trouble generating a loop for my post. The JS calls the slide_ID which then needs to display each slide-ID in numeric order for it to work. Example for slide-1 to scroll to its next slide ...
0
votes
3answers
56 views

Echo the number of posts being displayed

I had this code working as I needed it to...but now I need to add a post count where the "____" is, beside "posters", so I can manipulate the css depending on how many posters are showing, for ...
0
votes
1answer
47 views

Exclude a category of posts in author template

I'm using the following author archive code: <?php /** * The template for displaying Author Archive pages. * * @package Cryout Creations * @subpackage Parabola * @since Parabola 1.0 */ ...
0
votes
1answer
17 views

How do I control the fallback query after the original query returned cero posts?

I just figured out why WP developers expect you to create a separate 404.php page to control the output of that page. (and the silence about any attempt to do it otherwise) It's basically because ...
0
votes
0answers
35 views

query_post causes the posts to be loaded twice on load more posts

I am using query_post to randomize the posts in a custom post type. However this causes the posts to be loaded reloaded when i load more posts in. Below is my code: <?php ...
2
votes
0answers
59 views

Keep featured content post in homepage with original order

I'm searching how to keep the featured post in my blog homepage without excluding it from query post. My blog uses the Twenty Fourteen theme. I found this solution. Open the featured-content.php ...
0
votes
0answers
13 views

Getting latest posts from network [duplicate]

I'm using example from here to get latest posts from the WP network: http://www.smashingmagazine.com/2011/11/17/wordpress-multisite-practical-functions-methods/ The function: function ...
0
votes
1answer
38 views

Wordpress query portfolio posts

On my template I have this code <div class="blog_block"> <?php wp_reset_postdata(); ?> <?php $nbmax= 9; ?> <?php $tarali_query = new ...
1
vote
0answers
100 views

ACF Plugin - Dropdown menu of Posts based on Date Picker range [closed]

I am building a website with a Custom Post Type, "Events". I would like to use the Advanced Custom Fields (ACF) Plugin to provide custom fields for this post type, 2 of which will be ACF Date Picker ...
0
votes
3answers
187 views

Display content from a specific category

I'm trying to get my news page to display content from one category only (number 3) but I cant seem to get it to work. Instead of just displaying posts from category 3 it displays posts from all ...
0
votes
2answers
102 views

Nested WP_Query breaking loop

I'm using WP_Query to get all pages without subpages. For each page I'm using again WP_Query to get all child pages of the current page inside the first loop. This all works fine and I'm getting the ...
-1
votes
1answer
526 views

How to Display Post View Count

I am trying to display post view counts. I've tried below function to display the post view count, but I'm getting same post view for all the post in loop. Not getting correct post view count. ...
0
votes
1answer
128 views

Display specific posts on home page

Can someone please help me figure out if the "List category posts" plugin is the easiest solution to my problem: My goal is to be able to choose which posts are displayed on our homepage under ...
0
votes
1answer
76 views

Remove duplicated posts in the loop if post has more then one categorie

I have some posts with more then one categorie. In the post loop i get the post based on the selected categorie by the user. If the user select 2 categories where one post is assigned to, the loop ...
0
votes
1answer
471 views

How to pass multiple checkbox values to wordpress query?

I am working on a website that has multiple check boxes and I want to show results based on what user has selected. There are about 16 check boxes for music, 8 check boxes for venues and 6 radio ...
1
vote
1answer
33 views

How To Get Posts With A Specific Word

How to retrieve posts with a specific word in the loop. For example, I want to retrieve all posts with the title of the profile post (custom post type): ...
0
votes
1answer
62 views

get post excerpt by query

I'm trying to get post excerpt by query my code is below global $wpdb; $posts = $wpdb->get_results ("SELECT post_title, post_excerpt FROM $wpdb->posts WHERE post_status = 'publish' AND ...
0
votes
1answer
31 views

Adding a category at even positions on main loop with modified pagination

I have different categories showing over main loop. I want to add a specific category post at even positions of main loop. Example current post list with categories: cat1 cat1 cat1 cat1 required: cat1 ...
0
votes
3answers
55 views

How would I get 1 latest post from a query for 5 posts?

So I have a wp_query which is getting the 5 most recent posts from my Wordpress site. What I want to do is from within this query, grab the most recent post and show this as a sort of 'hero' post, and ...
0
votes
0answers
277 views

Query Posts From Multiple Post Types

Is there an easier or more efficient way of querying posts from multiple post types by the date of which they were published? I read this question here: Using Query Posts With Multiple Post Types And ...
0
votes
0answers
19 views

Styling every second Post differently? [duplicate]

I wanted to style every second post inside of a query post and I found a solution which nearly works. the thing is: it outputs just two posts (older ones will be igrnored) but i want to output ALL ...
0
votes
2answers
98 views

Only display posts with comments

I would like to query out only posts that have comments. So posts with comment_count = 0 won't show but anything above that will. This is what i query but it still picks out posts that doesen't have ...
0
votes
2answers
366 views

How to limit the number of results for all query_posts on mysite

I have a huge number of posts and the pagination with no limits eats my server CPU and ram so I need a function to limit the number of posts for all query_posts on my site and I need this function to ...
0
votes
2answers
331 views

Wordpress query_posts by tag doesn't work anymore(?)

I had this code running fine forever. Some days ago it just started outputting nothing (just the <ul></ul>). No errors in logs: <ul style="margin-left:0"> <?php ...
0
votes
1answer
399 views

post_name empty after wp_insert_post

I'm writing an external tool that inserts post in wordpress (I'm using the wordpress functions). I read also this discussion: wp_insert_post does not write my post_name But my problem is a little ...
0
votes
2answers
215 views

Insert custom div between posts

I'm using twenty twelve and I need to insert a div between the posts. I'm not sure how to stop the loop, insert the div, and then restart the loop. Can anyone shed some light on this? Thanks.
0
votes
0answers
36 views

Limit posts displayed to 2 specific posts

I'm using the Twenty Twelve theme. I have created a basic page. What I want to do is keep 2 only posts (that I select) on the page at all times. In looking at the code I think this is the section that ...
0
votes
1answer
484 views

WordPress displays post on subcategory only

I'm using WordPress on developing a site and a self-made template. I got 1 page to display all categories with its post. This is what I want to do: Main Category subcategory1 post 1 subcategory1.2 ...
0
votes
1answer
97 views

How to get posts ordered by using their categories?

I have a page where I've got all the products on a single page. -- Link to the test site. What I'd like to do is to get the products ordered using their categories. Juices, nectars, concentrates, ...
1
vote
1answer
82 views

Multi row post list

I'm trying to create a 'two posts per row grid'. Here is the template i made: <div class="row"> <div class="span2"> <?php get_sidebar(); ?> </div> <div ...
0
votes
0answers
42 views

Custom Fields & Posts

I've got one template, which I use on many different pages. The problem is that I want to show different posts according to their "pagename" category. Ex. "About" is going to show "About category" ...
0
votes
1answer
298 views

Order posts alphabetically: how to set order=asc in mysql query?

I have this function: global $wpdb; // adjust the query to fit your needs $posts = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE post_type = 'post' ...
0
votes
2answers
73 views

WP_Query articles order by offset in collumns

The code below wants to show a list of articles in two collumns. <?php $i = 0; $the_query = new WP_Query( 'showposts=35&offset=0' ); while ($the_query -> have_posts()) : ...
0
votes
2answers
75 views

While loop articles - if statement order

I want to show a list of articles, but I want to show in the 1st place my second article and after it the last. Eg: Article 1 Article 2 Article 3 Article 4 to be: Article 2 Article 1 Article 3 ...
0
votes
1answer
109 views

do more action after I publish a post

I am using wordpress3.5, I need to write post information to a file after I publish a post successfully. What I am not know is When I click Publish button, what function wordpress invoke to save ...
0
votes
1answer
52 views

why the same code got different results when using query_posts in functions.php and index.php

I am using WordPress 3.5, and my blog sites have many registered users. After they log in, I want them to see just their own posts, not others. So I added this to my functions.php, but I get a blank ...
0
votes
1answer
212 views

Retrieve only posts from a specific user in wp-admin/edit.php

I create a role and set capabilities for a group of user. $userdata = array( //something ); $uid = wp_insert_user($userdata); if(!empty($uid)){ $blogger = new WP_User($uid); //add role ...
0
votes
1answer
148 views

How to get all post titles starting with numbers and symbols?

I want to get all posts which are starting with a number (0-9) or symbols, in a list. I managed to get it work for letters, but this one is harder for me. Can someone help me out please? I tried ...