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

learn more… | top users | synonyms

0
votes
1answer
50 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
15 views

Redirect after post deleted

On the single template, I am using a delete post link generated by the get_delete_post_link function. When I use the link to delete the post I am currently on, it adds a query string of ...
0
votes
0answers
11 views

how to centre featured image on blog post [on hold]

I'm trying to centre the featured image for the single blog posts. This site is a subdomain, isa.kristinleeb.com. I went through this already on my main site, kristinleeb.com, and I ended up removing ...
0
votes
1answer
15 views

Pagination on Single Post

I'm looking to set up pagination on my single.php file so I can have my infinite scroll function correctly. I know that pagination can be put on a single post but I somehow need to make the single.php ...
-4
votes
1answer
23 views

Can I have a specific template for products even if they are standard posts and not CPT?

I'm attempting to manipulate a plugin for a client (the plugin author is unresponsive), and I'm wondering if/how to go about doing this. It's an ecommerce plugin, however does not create a custom ...
0
votes
1answer
40 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
0answers
23 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
1answer
53 views

WordPress object for comments frame [closed]

For two days I have tried to make this code work. I want to add a comment frame in single.php. I got this code to put it in the single page's template: <script type="text/javascript" ...
0
votes
0answers
29 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
1answer
36 views

is_singular() not working if called via callback function of admin-ajax.php

In my single.php I've some code like this ... if(is_singular('post')) { echo 'Blog'; } else { echo 'CPT'; } If I approach single.php from blog or CPT index page by using the_permalink(), ...
0
votes
1answer
21 views

Custom Post Type Specific Post Template

I created a Custom Post Type, and here's the entire code: // Register Custom Post Type function wrestler_register() { $labels = array( 'name' => _x( 'Wrestlers', 'Post ...
0
votes
1answer
8 views

Changing the display of the themename_posted_on() function

At present, this is what the pl_dev_posted_on() function is displaying: Where can I find this function to be able to edit what it displays?
0
votes
0answers
28 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
51 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
2answers
88 views

How to add shortcode tags in single.php

In my theme has one shortcode tags to display tags of post and function to load content post. But in function doesn't include shortcode tag. Now I want to add it to function but i don't know how to do ...
0
votes
1answer
43 views

Get_the_author doesn't return author name

I insert author box below my post and use get_the_author to return author name but it doesn't working. It also doesn't working with Search post by author. Hope everyone give me solution, thank in ...
0
votes
1answer
23 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
41 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
2answers
65 views

Single Page for two custom post types

I have a child theme with two custom post types 'jazz clubs' and 'jazz festival'. I would like the single.php to either display different content dependent on whether the post is from jazz clubs or ...
0
votes
1answer
48 views

wp_query issue with post_type = page

I am using a custom query to get pages. I need them all displayed on the front page for a one page WordPress theme. For the most part, I have the theme working and things are fine. I have this problem ...
0
votes
1answer
91 views

Post Thumbnail on Single (if elseif else)

I have the following news articles on the frontpage of a website I'm currently working on: For this I'll need to write two simple PHP if statements, which I've already done successfully, but on the ...
1
vote
1answer
190 views

How to disable the single view for a custom post type?

I created a custom post type: register_post_type('sample_post_type',array( 'labels' => array( 'name' => _x('Sample Posts', 'post type general name'), 'singular_name' => ...
0
votes
1answer
31 views

Conditional Tags If Custom Post Parent & Child?

Check on the single-artists.php whether we are viewing the parent or child of the said custom post? Tried this but always shows the top child content, rather then showing the two different area ...
0
votes
1answer
47 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
0answers
98 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
35 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
3answers
97 views

Is_single() conditional tag returns null in query

Trying to figure out why this won't work for me. I'm simply trying to run a loop of all posts and pages, and tag them as post and page in a array. But the is_single() conditional is not working, all ...
0
votes
0answers
59 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
439 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
16 views

Pagination on Single page doesnt work [duplicate]

I am trying to have a list of other/previous posts with pagination on single page under the main post, But the below code doesn't work. Can someone point out where am I getting wrong here? <div ...
0
votes
1answer
37 views

Single.php different behaviour from admin to non-admin

For the same post, I have suddenly a weird behaviour of single.php file between normal user and administrator. In the beginning of the loop, I perform: echo '<pre dir="ltr">'; ...
0
votes
1answer
34 views

How can I check which archive has referred the single? [closed]

I have a single page that displays one and only one category of the post that is showing. However the post can have more than one category. If the user arrives from a category page I want to show ...
0
votes
0answers
53 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
56 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
1answer
92 views

single.php doesn't getting style

i'm embedding a wordpress blog in a html page and i did the steps to successfully add the header and the footer of my site www.srougi.biz/soulfighter/blog. But now I need to stylize my single.php that ...
0
votes
0answers
26 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
1answer
227 views

custom single.php not working

Trying to solve this issue for the past hour and I can't figure out what's going on. Trying to create single-blog.php (I have a few posts which are under the category 'blog') but Wordpress ...
-1
votes
1answer
163 views

Insert Shortcode exactly at the end of the content

<?php echo do_shortcode("[sharethis]"); ?> <?php wp_related_posts()?> There are 2 short codes above 1) share this plugin short code 2) related posts short code now my ...
0
votes
0answers
45 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
1answer
37 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
0answers
46 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
51 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 ...
0
votes
1answer
31 views

Custom single page based on which custom page template is selected

I have two custom page templates ("template-blog-left.php" with the sidebar of the left side, and "template-blog-right.php" with the sidebar on the right side.) but I don't know if there's any way of ...
0
votes
1answer
65 views

my single.php is mixup on some post for no reason

some of my post is shown well(like http://exam.downloadkaran.com/?p=453) but another post is not shown well(like http://exam.downloadkaran.com/?p=258)!!! i don't know exactly what should i have to ...
0
votes
1answer
1k views

Single.php - Get Current Parent Category

The Problem I'm trying to display the current parent category title with the post title right under it. The problem is, I can't seem to get the posts current category inside or outside of the loop. I ...
0
votes
1answer
102 views

wp-link-pages in header and footer of the post

I would like to work the wp_link_pages functions a bit. In header of the post starting with second page I would like to have a link to previous page, Continued from page 1 where 1 is the number ...
0
votes
1answer
423 views

Single.php Active Category Class

Currently by default (I believe) when you're on single.php, Wordpress doesn't add a "Active" class to the blog category you're viewing the single post in like it would for pages or if you're on the ...
1
vote
1answer
107 views

Adding conditional content to single post-type template

I have a new custom post type set up that will be where an online copy of our email newsletter lives, like any web-based archive of newsletters. I am trying to create a conditional statement to add ...
0
votes
1answer
59 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
53 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' ...