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

learn more… | top users | synonyms

2
votes
3answers
1k views

How do I create a widget that only allows a single instance?

How do I create a widget that only allows a single instance of a widget to be added through the Wordpress interface? The default behaviour of widgets allows multiple instances to be added. I am ...
1
vote
3answers
856 views

Custom post type not displaying content from single-{custom post type} page

I am trying to create a custom post type with taxonomy and a shortcode for my custom search in a plugin.When I activate my plugin I see my CPT and taxonomy on dashboard. But when I publish the post I ...
0
votes
2answers
78 views

How to get a list of term names of the custom post type im currently on in single.php

Ok so I have a custom post type of "Products" and a custom taxonomy of "Types". Now in the types taxonomy I have dozens of categories and sub categories assigned to custom post types. Custom Post ...
0
votes
0answers
76 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
698 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 ...
0
votes
1answer
957 views

is_singular won't call my functions?

Hi i'm using this code to call for a different stylesheet for a single post type but the problem is, It won't call the stylesheet. It's in header.php, i also tried placing it in single.php <?php ...
0
votes
3answers
982 views

Force redirect single.php to index

I want to make a force redirect for single.php to index so that it is never reachable by direct access (the site is built in a way that you retrieve all the content on the index page, still need to ...
0
votes
1answer
121 views

How to show a post single post in page template

Currently I've divided posts into 5 different categories, based on the categories I've created 5 page templates. all of the pages are listed into the home page navigation menu. in my home page I'm ...
0
votes
1answer
238 views

Post X of Y in single.php / sidebar.php

Is there a way of putting "Post X of Y" into my sidebar? I think I can only show it when it is a single blog post (something like checking if the content is_single) but I want to be able to see which ...
4
votes
2answers
98 views

How do I create a link that will always show the latest post?

If I want to create a link that will always show the latest post how can i do that? Lets say I have three post types and there are three links with posts names (like a nav list) to those post types. ...
2
votes
2answers
2k views

Custom permalink structure only for default posts

Does anybody know how to modify the url struct only for the single post page? When I go to a post page, the url should look like: example.com/xxx/my-post. All other urls (with the exception of the ...
2
votes
2answers
539 views

Best way to programatically add “rel” attributes to page and post images

For single posts and pages, I would like to add certain rel attributes to all the images on the contained therein added with the "Add Image" functionality on the edit screen. The attribute would be ...
1
vote
1answer
140 views

Add code just after Post content

I am in a bit of dilemma here so bare with me. I want to add something like this code just after the content in a post: <p>Please let me know what you think by <a href="#comment">leaving ...
2
votes
1answer
1k views

HTML code in Custom field

I'm using a custom field to display images in a slider on each post, but when I update the post after having entered the HTML code in the custom field, the code disappears. I'm assuming that there is ...
1
vote
2answers
119 views

Template for specific post of custom post type

I have the CPT "event". I have created single-event.php. I want one particular event to use a different template than single-event. I read elsewhere that this could be done by creating a ...
1
vote
3answers
838 views

Is it possible to use a single custom post as the site front page

I know I can set a static page as the homepage but is it possible to set a single custom post as the site front page? I created a custom post type called "portfolio" where users can add all the work ...
0
votes
2answers
39 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
1answer
94 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
73 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
1answer
764 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 ...
0
votes
2answers
2k views

How do I create a single.php for a specific category?

I am trying to create a single.php file for a specific category on my site. Instead of loading the single.php file I want WP to return that category in a file called single-category-53.php (the actual ...
0
votes
2answers
981 views

Possible to paginate on single.php?

I know this sounds illogical and maybe it is, but the client's asked for it so I'm looking into a solution if possible. On a section of the site there's a link that leads to category-news.php, which ...
0
votes
1answer
97 views

Display “Post 2 of 4” on single post page?

I have a custom post type called Projects. When viewing a single 'project' post I have next/prev buttons to navigate through them. I also want to display text saying "Project 2 of 4" or ideally ...