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

learn more… | top users | synonyms

0
votes
0answers
86 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
89 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 ...
1
vote
2answers
373 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
288 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
39 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
94 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
200 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
113 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
340 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
3answers
1k 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
62 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
69 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
141 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
3answers
275 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
79 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
1answer
615 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
46 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
45 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
68 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
70 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
210 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
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
1answer
508 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
277 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
69 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
81 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
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 ...
0
votes
1answer
36 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
76 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
2k 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
113 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
676 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
116 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
79 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
600 views

Show single post then all posts (with pagination)

On my single.php I would like to show the single post then list all the posts with a pagination. I use the following code: <?php while ( have_posts() ) : the_post(); ?> <!-- Show single ...
1
vote
2answers
1k views

Display Taxonomy Image on single.php

I'm using Taxonomy Images, and I can't figure out how to display a category's associated image on a single.php. Essentailly, when a user is viewing a post that utilizes the single.php template, it ...
-1
votes
1answer
210 views

How to add share buttons in single.php?

In Settings->Sharing, the admin of a site can decide what share buttons to add to every posts, ex: Facebook, Twitter, etc. I am coding single.php and I can't find what to insert to show those social ...
0
votes
1answer
3k views

the_excerpt() in content.php and get_template_part() in single.php

everybody. So I'm creating a blog theme and have put the_excerpt() in content.php My index.php displays different post excerpts for the different kind of posts-formats. I have content-gallery.php, ...
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
397 views

Insert After Second Paragraph Without <P> Tag?

I use a code like the one shown below to insert ads after the first paragraph. The problem is that this code requires the content to be displayed within paragraph tags and I would like to use this ...
2
votes
1answer
381 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 ...
0
votes
1answer
170 views

Set a cookie only in single posts

I'm trying to set a cookie when a user is on a single post. I'm keeping track of how many single posts he has read this month. I have two problems: I have a custom template and added the following ...
1
vote
2answers
433 views

Custom Post Templates

The Issue: I am looking for custom single post templates, to add or remove individual elements as a function of a normal single post. There are a lot of ways to create custom post templates for ...
1
vote
2answers
187 views

Restrict post navigation to current sub menu

This is what I'm using to output my post navigation: <?php if (is_single() ) { ?> <nav class="post-navigation"> <h1 class="visuallyhidden">Post Navigation</h1> ...
0
votes
1answer
3k views

Archive page for custom post type not working

I use a plugin called CPT-onomies to create Custom Post Types. I created a post type called "case", and set "Has Archive Page" to true, but when i try to view a single case, i just get 404'd. Same ...
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
33 views

Exclude single page from function

//wraps the permalink around each thumbnail add_filter( 'post_thumbnail_html', 'my_post_image_html', 10, 3 ); function my_post_image_html( $html, $post_id, $post_image_id ) { $html = '<a ...