0
votes
1answer
30 views

How To Pick “full/thumbnail” Image In A WordPress Loop?

I am picking WordPress latest post through WordPress post loop for that I am using the below code but in this its picking all images at full size. <?php if ( have_posts() ) : ?> <?php while ...
0
votes
0answers
24 views

how to show a tooltip include of thumbnail and excerpt when hovering a post link in other post?

Is there any way to call thumbnail and excerpt for link of post in another wordpress post? For example when i hover a post link in other posts, it shows a tooltip include of thumbnail, excerpt. Like ...
0
votes
0answers
13 views

Nested get_template_part / WP_Query – How should I do this?

I'm running a loop that runs a certain get_template_part, and that template file itself should then run another get_template_part, with the purpose to get some posts, is this even possible? At the ...
0
votes
2answers
18 views

Do not show children of a category

I'm trying the next code: $categoria = get_the_category(); $hijosCategoria = (array) get_term_children($categoria[0]->term_id, 'category'); $queryBase = ...
1
vote
2answers
30 views

Fetch posts from current week (Sunday to Saturday)

I'm trying to fetch posts from current week. <?php $args = array( 'date_query' => array( array( 'year' => date( 'Y' ), 'week' => ...
0
votes
0answers
16 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 ...
1
vote
1answer
41 views

Future post ID not showing

I'm attempting to send an email notification when a scheduled post is published. I've tried quite a few different ways. I receive the email but the id (and other random details) are not published with ...
6
votes
1answer
154 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
0answers
27 views

How to show the posts list into a static page? Problems to use the loop into a static page

I have the following problem: I have to create a posts archive into a static page. So I have created this page template containing the loop to interate on my posts: <?php /** * Template Name: ...
0
votes
0answers
33 views

global wp_query returning wrong post vars

I am currently filtering the_posts to recreate wordPress' "sticky post" function for custom post types. I also have to make sure that the sticky post is attached to a certain taxonomy term that ...
-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
123 views

Create new Wordpress post [wp_insert_post] based on results of a WP_Query

I have a a page where users can filter a list of custom post-type posts based on the "Ultimate WP Query Search Filter" plugin. Results are passed to a div on the page using AJAX from there users can ...
0
votes
1answer
30 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
1answer
43 views

list posts of two post types in a single template

I have two post types. One is post & other one is event. Both sharing same categories & tags. I am listing the posts by archive.php. Now I am listing the posts as general by two different ...
0
votes
2answers
76 views

Custom WP_Query not working correctly

OK, So I have created a custom WP_Query that gets the post_type post and outputs it as a styled list. It works well and outputs the styled list but then underneath it displays all the posts again but ...
0
votes
3answers
65 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
70 views

Display posts of specific category term

I'm using this code to first display each category term as headlines and then display a post which is assigned each category term under the headline. If I create a custom taxonomy it works as ...
0
votes
2answers
40 views

Variable not working in WP_Query

I have used this technique before and cannot work out why this time it is not working. 'news_category' is a custom taxonomy of my custom post type 'News'. I am getting the taxonomy of the current ...
0
votes
1answer
18 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
116 views

Filter Wordpress post Dynamically on dropdown selection?

Want to filter Wordpress post Dynamically on dropdown selection? But am not able to find out any solution how it can be done.Any help appreciated. Thanks On Clicking On Latest to Old the post ...
0
votes
2answers
332 views

Pagination not working on Custom Page Template

I searched a lot on this but I can't figure out why my code is not working. I published a page with slug "blog" that uses a custom built template "page-blog.php" that I build from editing the ...
0
votes
0answers
73 views

Query category-specific, paginated posts and allow viewer to change sort order

Maybe this has already been asked here, but I can't seem to find a solution, so forgive me if this is a duplicate. I have coded a custom template to display all posts from a category with the ID 36. ...
3
votes
2answers
113 views

Adding Post Counts to Menu (Nav) Programmatically?

I'm fairly stumped on this. Without getting too query-heavy, I was wondering what path one might take to produce a menu that links to a category of posts, and displays in parenthesis how many new ...
0
votes
0answers
48 views

When WP_Query only returns 1 post, how do I automatically redirect to that post?

I've been searching around for a few hours now and can't figure out how to do this. Seems really simple. I've seen lots of redundant examples on how to redirect to a single post when a search result ...
0
votes
1answer
40 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 ...
-5
votes
1answer
59 views

custom sort posts in archive/taxanomy page

I want to override the default sort order of posts in archive and taxonomy pages. what hooks should I implement?
0
votes
2answers
117 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 ...
0
votes
1answer
66 views

Sort posts by activity date

I have a list of posts posted on different dates I can order the posts by date $loop_args = array( 'post_type' => 'post', 'order_by' => 'date', 'order' => 'ASC' ) How can ...
1
vote
1answer
27 views

How safe is renovating $wp_query when doing WP_Query pagination in Page Template

With a lot of search and trial&error, I's unable to do the pagination in a custom page template. I's not actually tired, but frustrated, why the most common err issue is not explained in a way so ...
1
vote
2answers
57 views

Posts for next month

How would one get posts that are set to 'future' to display in a loop? I am trying to figure out how to get posts that are in the future months. So if we are in April I want to display posts for May. ...
0
votes
1answer
39 views

Current and next month posts

Thanks for reading firstly. I am coding a site that requires 3 post titles for the current month and 3 post titles for the next month (upcoming events)! I am struggling to get this to work. I am ...
-1
votes
1answer
83 views

List posts related to category on a div [closed]

i want to display posts related to selected category at the same page(on a different div). What i want is as the image attached, when i click the category name on the left side, all related posts must ...
1
vote
2answers
104 views

Why won't my taxonomy query show up?

I'm attempting to display posts from a 'Uncategorized' category under a custom taxonomy called 'Reviews' but without much luck. I'm using get_template_part('loop','review') to call loop-review.php ...
0
votes
1answer
87 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
0answers
139 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
2k views

Get current post id in functions.php

I have a wp_localize_script() function in my functions.php where I need to push the current post ID of the current post to a jQuery file. So I was wondering how you can get the current post ID of a ...
1
vote
0answers
157 views

Posts 2 Posts: Get related posts from user connected to current post? [closed]

Hopefully someone can help with this. I have a CPT called "Tours", and I'm using Posts 2 Posts to connect Posts inside that CPT to Users. Relationships being: Tour Item 1 > Tour Operator 1 Tour ...
0
votes
1answer
843 views

Get first post from wp_query

How can I get the first post from a WP_Query result? $connected = new WP_Query( array( // Arguments )); // This doesn't work.. echo $connected[0]->post_name;
0
votes
1answer
54 views

Why does WP_Query show only the same post even with different categories and endwhile?

I have 3 divs that WP_Query with 3 different categories and end it with the php endwhile,but it only shows the same most recent post query three times over. Do I need to hard reset the query loop ...
-1
votes
1answer
210 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. ...
0
votes
1answer
119 views

Show custom post type filtered by category

I would like to have a custom post type which contain several sliders for showing in each category page (exact category.php), one for each as planned. All sliders were assigned to related category. ...
0
votes
2answers
199 views

How to get Tags with specific post id

I have created one post and post ID is 34 and added some Tags and Now I want to retrieve all tags with post ID. Any Idea?
0
votes
0answers
30 views

Serve different layout via URL parameter

I'd like to be able to serve up an alternative layout for single posts via an URL parameter. For example, a user going to: http://domain.com/postname/ will get the post in the normal layout and a ...
0
votes
2answers
82 views

Get posts after calculating meta key

I have 2 meta fields for the posts, eg. meta_value and meta_count. Both are numbers. I want to divide meta_value by meta_count and based on the results I want to fetch the top 10 posts. So for ...
0
votes
2answers
117 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
24 views

Pagination for custom query won't let me back on page 1

I have a custom query … <?php /** * The loop that displays the posts. */ ?> <ul class="post-items"> <?php $args = array( 'post_type' => array('post', 'wr_raffle'), ...
0
votes
2answers
191 views

How can I show many posts an author has per week?

I've searched around and have had no luck or success in finding a way to show how many posts an author has made in a certain period of time (e.g. - a week) Any ideas on how one would approach this? I ...
1
vote
1answer
128 views

How do I “get the next 10 posts after post_id == x”?

I am building a mobile application that is pulling the json feed from a blog. I can easily query to get the latest 10 posts for example. But next, I want to be able to query the next 10. This presents ...
0
votes
1answer
124 views

Order posts by separate menu order for different sub-categories

My scenario is as follows: Categories: 1. Category A - Sub-Category A1 - Sub-Category A2 - Sub-Category A3 2. Category B - Sub-Category B1 3. Category C 4. Category D The ...