The single post template. Used when a single post is queried.

learn more… | top users | synonyms

2
votes
1answer
355 views

Enable infinite scroll on single.php

I have a problem similar to the author of this thread: Possible to paginate on single.php? I am trying to enable infinite scrolling on single.php. So far I successfully load an additional 1 post when ...
1
vote
1answer
959 views

Displaying Meta Box Image

I have some problems displaying info from my custom meta box in my custom post type single. I'm using Reusable Custom Wordpress Meta Boxes by Tammy Hart. I'm able to display the textfields using ...
1
vote
1answer
719 views

Single post comment template not working

I cant get the comments template to show up in my single-events.php This is my code <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', 'events' ); ?> ...
0
votes
1answer
24 views

posts_nav_link on single post template

I have a post type called journal and on the single-journal.php template I am querying the rest of the journal posts like so: <?php query_posts( array( 'posts_per_page' => 4, ...
0
votes
1answer
17 views

My post views doesn't seem to be counted correctly

I'm using the following codes to count my posts views, so that I can use it in a widget, but it doesn't seem to be updating correctly. I know some posts have more views than the ones showed on the ...
0
votes
1answer
28 views

Style Wordpress Custom Post Type Single Page

I'm registering a custom post type 'events'. The events can be listed using a shortcode, and when you click on an event you go to the single view of that event. Now, I want this single view page to be ...
0
votes
1answer
37 views

How to check if a post is in categories x,y,z inludint their subcategories

I am trying to check whether a post is in categories X, Y, Z (including the subcategories within them). This is the piece of code I have tried in my single.php: if ( in_category(array( '1', '2', ...
0
votes
1answer
48 views

404 Page Not Found for Only One Post

I have 40+ posts on my blog. Only one of them is going to a 404 page when I click the title (visit the permalink). To see it in action: http://thegrovestead.com/tag/strawberries/ Look for the post ...
0
votes
1answer
35 views

image class removed in excerpt

I have inline images in my post content that have classes. the classes are available as I go to single page like this: <img src="the_cource.jpg" class="myclass"> , but are removed as I look ...
0
votes
1answer
24 views

Display Referring Category on single post?

My site is built in such a way that every single post (in a custom post type) is accessed via a category archive (custom taxonomy). Every post may have more than one category assigned, but I want to ...
0
votes
1answer
25 views

Having single posts appear under the blog homepage and highlight menu items properly?

My Wordpress site which has a static frontpage and the blog page assigned to a subpage of a section. My blog's homepage is: /be-the-first-to-care/first-to-care-blogs/ This works great for the blog ...
0
votes
1answer
55 views

Including all post id's of a custom post type into an array

For my single.php (products.php), I try to build a navigation via which the user can switch between products based on the meta key "price". I want to put all id's of the products post type into an ...
0
votes
1answer
70 views

single.php not pulling in any data from database

My single.php doesnt seem to be fulling any information through from the database for the current post. here is my single.php code: <?php get_header(); ?> <div class="main-container"> ...
0
votes
1answer
49 views

Two single.php files?

I have a custom post type "people". For each person, I can enter the following custom fields: "address", "occupation" and "pictures". In the single-people.php I display the address and the ...
0
votes
1answer
37 views

Pagination and Related Posts

Is it possible to use pagination with the following related posts code, which is embed in single.php of my theme. <?php // for use in the loop, list 5 post titles related to first tag on ...
0
votes
1answer
83 views

How to Highlight current category on category and single page template?

On Wp Forums, I found a code that shows categories with images and it works very well. But I couldn't figure out how to highlight current category on category.php and single.php Here is the code that ...
0
votes
1answer
67 views

Query child posts on parents single.php?

Is it possible to query the child posts of the single post your on? i.e you have a custom post type called apples. The parent page is... single-apple.php On that page query and display all its own ...
0
votes
1answer
77 views

Using custom templates for post_is_in_descendant_category

I'm using this function on functions.php and the goal is to call a specific template for any post inside a main category but this isn't working when I need to call a generic template for any other ...
0
votes
1answer
78 views

Image format not using single-image.php

I am trying to isolate a particular post format for images, and reading the Codex, I thought it would be possible to create a new template file single-image.php. However, that file is not being used. ...
0
votes
1answer
61 views

Single post page from static home not working

I'm struggling with displaying a single post page. I have the following code on the static front page: <?php $args = array( 'numberposts' => 5, 'order'=> 'ASC', 'orderby' ...
0
votes
1answer
91 views

Get current post's child page?

Is it possible to find out what page a post is contained in? Im in my single.php template and im listing child pages in a sidebar using wp_list_pages, I want the page (not category) that the post is ...
0
votes
1answer
78 views

Parent for a single (single.php)

Is it posible to get the parent ID of an single page.... I mean not a Page I mean an is_single()... page. I have a page witch contains some custom posts and when I click on one of these i came to the ...
0
votes
1answer
76 views

Custom Style per Post, How to Display Custom-Styled Single post on Homepage?

This question probably has simple answer, but I'm not an expert programmer so lemme explain my question chronologically. I apply custom style for every single post, and it works using the following ...
0
votes
1answer
44 views

How to make a list of posts displaying them 5 by 5 with a “next posts” link?

I have been googling for the past 2 hours and haven't been able to figure this out, mainly because I am missing the right terminology, in other words, I don't know what I want in "wordpress words". ...
1
vote
0answers
34 views

On single.php, fetch 2 posts created after and 2 posts created before in relation to the actual post (using menu_order)

Looking for a way to on single.php fetch and show the actual post, and then by looking on the menu_order value of that specific post (lets say the post have menu_order value 3 in this case) go and ...
1
vote
0answers
82 views

How to make the link to the category for a post go to corresponding page number in archive?

For instance, I am at http://url.com/single-post and in the post there is a link to the category that navigates to http://url.com/category/page/3/ which is the corresponding archive page that contains ...
1
vote
0answers
106 views

Adding range to wp_link_pages();

I have some very long posts, some have more than 50 pages() and when using wp_link_pages it give me 50 internal post links, clearly this isn't usable. How can I add a range to the wp_link_pages ...
1
vote
0answers
98 views

Modified loop-single-forum.php to work inside of a sidebar Widget, not working on some site pages

So I took loop-single-forum.php, copied it and renamed it, fixed it so the site is calling the copy and then removed what I did not need from it to place it in a sidebar widget. It works beautifully ...
0
votes
0answers
11 views

show the post of all child category in different single page

i have parent category ('photogallery') that have 5 child category like latest,sports,business etc i wanted to show the post of that child category in another single php file that should be by the ...
0
votes
0answers
21 views

Get active term on single (CPT) page

I know similar questions have been asked here but I feel my case is slightly different. I need to get the active current term (object) on a CPT single page. However, the single post can have ...
0
votes
0answers
20 views

How do I get is_single() to return true when called internally from the_content()?

I have a custom page, e.g. blog.php?post=42 that shows a GET-specified post like so: <?php require('wordpress/wp-blog-header.php'); ?> <!-- my non-wordpress site's html goes here --> ...
0
votes
0answers
15 views

Get next post in category with AJAX?

I need a simple solution to load the next post in the category of the current post (in a custom single.php) with AJAX once the reader scrolls to the bottom of the page. I'm using a custom theme. ...
0
votes
0answers
27 views

Can I query another data table on a multisite with the single.php template?

Here's a quote from a thread on this forum showing exactly what I'm trying to do: blog 1 gets = wp_post table blog 2 gets = wp_2_post table Small multisite setup, two very different sites, both ...
0
votes
0answers
34 views

Permalinks not working for post IDs as slug

I inherited a site that has a lot of posts without a title, thus the permalink defaults to the post ID, with pretty permalinks turned on. IE - http://mysite.com/1200 When the permalinks are reset to ...
0
votes
0answers
24 views

A pagination-sort-of-thing on single.php view for the custom post type

First, a quick demonstration of what I need to achieve: It would work similarly to <?php previous_post(); ?> and <?php next_post(); ?>, but also include an actual "reel" indexing all ...
0
votes
0answers
64 views

how to load custom single.php?

Hi I have a blog where the categories are news, events and inspiration. These categories are selected using radio buttons on acf. I want to load news on single-news.php while events on ...
0
votes
0answers
163 views

If in_category not working for multiple single.php pages

I searched far and wide (on here & Google), reading about how to have multiple single.php pages for different categories of posts. The consensus was to do something like this: <?php /* ...
0
votes
0answers
51 views

How to: Get the first image from the next and previous post in single.php? (5 posts)

I know I can call a function below but it works in loop at index.php only. function catch_that_image() { global $post, $posts; $first_img = ''; ob_start(); ob_end_clean(); $output = ...
0
votes
0answers
83 views

Split the content of single.php by more tag and split texts and photos

I am trying to sprit the_content() by more tag. But I cannnot think of how to write the code for the photos(images) before and after more tag. Photos exists none or more by the post. If anyone know ...
0
votes
0answers
88 views

different single.php for different page templates

I have 4 page templates with same query. Is it possible to write conditional statement? If I go to single post view (single.php) from page template 1 (page-main.php) display something (for example ...
0
votes
0answers
138 views

CPT Main Loop Pagination in single.php

I have a CPT single template (single-work.php) where I need to repeat the loop of posts found in the main loop (archive-work.php). I am using the same loop code in both templates (as well as ...
0
votes
0answers
39 views

Get posts that have been read by logged in users

I am using buddypress. I want to know what posts each user has read, and show a list of read and unread post for users. I don't know how to do this. Should I be using custom fields, via add_user ...
0
votes
0answers
77 views

Modify / Rewrite single template url structure

Is it possible to add the post category name to the the WordPress single template url structure if i am not using category pages to build the site menu? from www.domain.com/single-post-title to ...
0
votes
0answers
587 views

Load more posts (Ajax) in tabbed sidebar on single.php

I'm trying to use this approach http://wordpress.stackexchange.com/a/56349/18144 to create a 'load more' button in the sidebar on single.php. I would like to able to load more posts in a sidebar tab ...
0
votes
0answers
66 views

Single.php loading fully on localhost but not on server

The title explains the issue. I did my best to find reason behind such dysfunctionning. Can you please tell me what can be the causes of such issue? Any techniques to investigate the problem are ...
0
votes
0answers
69 views

Start image download by mouse click and insert counter

i use this code: <a href="<?php if (has_post_thumbnail( $post->ID ) ): ?> <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); ...
0
votes
0answers
27 views

Gallery Short Code

I am wondering what would make the gallery short code not work and just display in posts as: [gallery] I am creating a custom theme, I have no plugins installed and the short codes I have made do not ...
0
votes
0answers
66 views

Using next_posts_link in related post of single post page

I am trying to do a related post query with a load more button, I have some ajax setup with this button to get more post from a url but the problem is next_posts_link does not work within a single ...
0
votes
0answers
55 views

Avoid replacing single quotes

In my WordPress widget I include a PHP file which hase the following content: <div id="<?php echo $args['widget_id']; ?>" data-style='{"width":"35px"}'> </div> However, WordPress ...
0
votes
0answers
54 views

Wordpress doesn't generate rel=prev & rel=next

I am developing a Wordpress theme from scratch and I've been using previous_post_link() & next_post_link() quite often and never had any trouble using them. Until now.. So what I'm trying to ...