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

learn more… | top users | synonyms

0
votes
1answer
22 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
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 ...
-2
votes
1answer
24 views

Display all product attributes on single product page [on hold]

on single product page I want to get all the assigned product attributes so shoppers know that this is the right product they want. on meta.php I droped the tags meta but want to show a table of ...
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
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
0answers
14 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
2answers
19 views

Custom post type single page returns 404 error

I have a custom post type called slide. It has content and some custom fields. I want WP to show the single.php theme or single-slide.php theme when the user clicks the slide single page link. 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
2answers
32 views

WordPress Single Conditional for Search Page

Is there a way to filter single.php so that if someone came from search.php it would display one thing, but if they came from anywhere else it would display another? Thanks, Josh
0
votes
2answers
58 views

List of users that clicked a 'Join' button at single post

The title might be a bit vague while I'm not quite sure how to describe it. What I want: At every single post (in this case of post type 'event') a logged in user must be able to click a 'Join' ...
0
votes
2answers
18 views

Comment text area in single blog post and show comments if approved

I'm modifying some existing code and trying to add the ability for user to leave comments on single post and then echo those comments based on approval. I need to add right below <?php ...
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 ...
1
vote
1answer
47 views

I want to extend the current themes' single.php to display the meta fields of my CPT

I am developing a plugin, which registers a role, a CPT and some metaboxes. I am now at the point where I included as well a single-mycpt.php into my plugin. Here's my current issue: I can't simply ...
0
votes
1answer
96 views

Single.php Category Post Count

I have the following code in my single.php file: <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); next_post_link('%link', 'Next', TRUE); ...
0
votes
1answer
35 views

Which is better and faster ? Wordpress Queries or SQL Query

Suppose I am developing a minimal theme, the the post page single.php displays only the post title, the excerpt and the content. So in general that would be <?php the_title(); ?> <?php ...
0
votes
1answer
47 views

Remove arrows from previous and next link

In the wordpress theme I am developing I inserted some code to display links to the previous and next posts which appears at the bottom of each post. The code looks like this.. <?php ...
0
votes
1answer
26 views

Single page problem when permalink type changed

I have a custom post type which i create and works perfect without any problem, its a team page to show some members in a company, also i created a single-team page to show more details about each ...
0
votes
1answer
47 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 ...
1
vote
2answers
70 views

Why use while over if in single wordpress posts?

Why is while() used instead of say if() here: <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', 'single' ); ?> <?php ...
0
votes
1answer
30 views

Post type no single page

I have created a post type and I am trying to create a single page for that post type, I am creating a php file called single-job.php and it is using the index.php as a template. Below is my function ...
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
1answer
34 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
0answers
23 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
1answer
47 views

Add wp-link-pages to post

I am trying to add wp-link-pages function to my post where I have images split into many pages in that single post. I already have next and prev button whose functionality is written javascript. I ...
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
53 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
2answers
69 views

Include latest author posts with pagination in single template?

I've inserted a WP_Query in my single.php template to show the last 12 posts of an author. Everything works ok, the 12 posts are being shown. Now, I want to have it paginated. So the user can see ...
0
votes
1answer
24 views

is_single(); Question

If a page would contain this code: <?php if( !is_single('') ): ?><div id="navtoggle"></div><?php endif; ?> But regardless of it would show the div navtoggle, would that mean ...
1
vote
2answers
247 views

How do I show google ads between post content?

I want to show ads by Google between text content, like show 3 ads one after 1st para second after 3rd para and one at end of last para. I know i have to modify in single.php but being novice in php ...
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
1answer
51 views

Problem with single-page for my custom post

I'm working on a website with a portfolio section, and I'm almost finished with this section, but I have a problem with the single page which is : whenever i click on any portfolio link, the single ...
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
29 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
3answers
339 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
28 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
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
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
1answer
67 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
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
1answer
232 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
41 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
9 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
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 ...
1
vote
2answers
332 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
248 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
36 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 ...