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

learn more… | top users | synonyms

0
votes
2answers
33 views

Integrating WordPress with Your Website

I am intergrating WordPress with a non WordPress site. I have installed WordPress at my evercam.io/wordpress and I have followed the codex and I have been able to display a list of posts on a static ...
0
votes
2answers
26 views

How to get nav to show current_page_parent class when on regular post (not blog), differentiated by category

In order to highlight menu item when viewing single post (not blog), am trying to add special classes to single, (regular, not custom) posts from different categories. this is the basic code: ...
-4
votes
2answers
26 views

Change CSS style default the_content [on hold]

I would like to change css style default the_content class="alignnone size-medium wp-image-51" to class="mycss" in the file single.php . Thank you
0
votes
0answers
10 views

Variation on a single page with CSS/Embed

I am a wordpress newbie and have a skeletal site I designed (http://theabraxas.us) which has a video and chat embed set up. I want to, on the front page of my wordpress site (http://abraxas.pw), have ...
0
votes
0answers
26 views

How to test a WordPress plugin on a single post?

I would like to test a plugin on a single post, where the ID = 12546. I tried is_single('12546') in plugin.php and $post->ID with global $post;. Any suggestions to get this working.
0
votes
1answer
41 views

How to reorder the content of the single post?

I installed the "Related Posts" plugin and use <?php the_content(''); ?> to show my single post in single.php. When I want to add the author's name after the post, I use <?php ...
1
vote
2answers
77 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 ...
4
votes
2answers
96 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. ...
0
votes
1answer
19 views

Insert a field with PREG_REPLACE – strange behaviour

I'm trying to insert a custom field (from the Advanced Custom Fields plugin), and I need to place it within a div which I'm wrapping around an img, right before the img-tag. So basically this is the ...
0
votes
0answers
20 views

Custom post type single display is ommited

I've created a custom post type: tutorials using generatewp.com generator and registered it with register_post_type(). I'm querying the list of tutorials in a custom page template like that: ...
0
votes
1answer
50 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
17 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 ...
0
votes
0answers
25 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
33 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
54 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
22 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
85 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
46 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
49 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
38 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
70 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
21 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
44 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
52 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
127 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
39 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
78 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
38 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
77 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
72 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
36 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
41 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
37 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
33 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
65 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
34 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
69 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
95 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
25 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
296 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
70 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
79 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
78 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
30 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
524 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
29 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
58 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
246 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
70 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" ...