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

learn more… | top users | synonyms

0
votes
2answers
26 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
44 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
14 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
14 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
45 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
71 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
30 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
34 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
21 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
29 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
62 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
28 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
27 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
33 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
15 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
41 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
21 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
20 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
44 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
61 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
23 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
186 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
55 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
42 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
68 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
28 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
261 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
46 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
118 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
65 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
47 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
172 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
36 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
73 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
81 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
259 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
167 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
31 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
72 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
124 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
87 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
248 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
692 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
57 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
66 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
137 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
36 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
223 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 ...