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

learn more… | top users | synonyms

2
votes
2answers
1k views

Single post comment template not working

I cant get the comments template to show up in my single-events.php This is my code <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', 'events' ); ?> ...
1
vote
1answer
1k views

Proper way to load a single post via Ajax?

I'm loading single posts via Ajax into a div that I have set up on my index page. Everything is working fine in this regard. I want to use history.js to push/pop the state so if users enter ...
0
votes
2answers
633 views

create single.php for specific category by category id

I'm trying to create template for specific category with id 1 for example. The template should be applied to all of the pages belongs to this category. So, it should be something like single-1.php. I ...
0
votes
0answers
20 views

Disable single post page in wordpress

I hate how when you click on a frontpage post (I have mine layed out in columns on my frontpage), it goes to the single view of the post. I would like for it to go to the blog page but scroll down to ...
3
votes
2answers
78 views

A special single page templates for posts under a category and all its child category

I have a blog in WordPress. I have multiple categories. I want to use a specific layout for all posts under a category and all of its sub categories. Example : My categories organized as bellow. ...
0
votes
1answer
513 views

Only nextpagelink on wp_link_pages

Does someone have a solution to display only the nextpagelink with wp_link_pages in single posts? I've tried different solutions, but none of it worked. As I reach the last page - wp_link_pages ...
0
votes
0answers
45 views

Add Read More Tag to a post content (Single.php)

I have wordpress custom theme made from scratch including: header.php, footer.php, single.php, index.php, functions.php For Listing the blog list i used index.php with excerpt and read more link to ...
0
votes
2answers
2k 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 ...
1
vote
2answers
1k views

Displaying Meta Box Image

I have some problems displaying info from my custom meta box in my custom post type single. I'm using Reusable Custom Wordpress Meta Boxes by Tammy Hart. I'm able to display the textfields using ...
0
votes
0answers
27 views

Using get_template_part() to modify single.php for a custom post type

I have a custom post type plugin called shows that has custom meta such as host, time, length, etc. I want to make it theme independent and require minimum coding for it to work across a lot of ...
2
votes
2answers
186 views

if is_singular array not working as expected

I'm using the following if statements within header.php to load custom tracking codes. <?php if ( is_singular( array( 'custom-post-type', 'post-name' ) ) ) : ?> // Specific tracking code ...
0
votes
1answer
53 views

WP_Query shows all posts on single post pages

Looking for assistance with WP_Query. I'm learning to create WordPress themes and I am practicing by creating a real estate theme. What I am trying to do is set up a properties page (custom post type) ...
1
vote
1answer
26 views

How to disable single post view in wp

I want know, How to disable single post view in wp. any plugin or setting??? Is there a way to disable single post page, for example when some tries to go to single post page to show not found or 404 ...
0
votes
1answer
37 views

Code to display category-specific single.php is overriding normal single.php, too

I have two different post type categories on the site I'm building at the moment - "press" and "blog". I used the following code, inserted in my child theme's functions.php file, to get the "press" ...
0
votes
1answer
32 views

What is wrong with my WP_Query Arguments?

In my single.php file I am using a nested WP_Query to show more posts, at the bottom of the page. My code for the query and nested loop are as follows: <?php $ep_args = array( ...
0
votes
0answers
25 views

Can a single.php file be coded to allow HTML download from a button?

I have been searching on WP and on SO for a way to code a custom-single.php to allow the HTML code in that document to be downloaded from a button on the rendered site. What I have done is created ...
0
votes
0answers
18 views

Hide Certain Tags on Single Post Page

I'm trying to hide certain tags from single posts pages. I've googled and found 2 codes but both are hiding the whole post page. I'm using a theme that needs using 2 tags ticker and slider to show ...
0
votes
3answers
525 views

Single page site + pushState?

I have a single page site with posts that get loaded via Ajax on the same page via slide down div. When a post is 'activated,' I want that state to be set so that when I visit the url directly, it ...
0
votes
2answers
1k views

How to add shortcode tags in single.php [closed]

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
2answers
66 views

Get term name without a foreach loop

I currently have this: <?php $terms = wp_get_post_terms( $post->ID, 'artist-genre'); foreach($terms as $term) : ?> <li> <?php echo $term->name; ?> </li> ...
0
votes
1answer
16 views

Pulling in Related Posts based on Post Type array

I'm trying to create a Related Posts section on my single.php file and I'm using this as a starting point (http://www.wpbeginner.com/wp-tutorials/how-to-display-related-posts-in-wordpress/) and my ...
1
vote
0answers
47 views

Issue with loading mobile specific custom single page layout in mobile

Hello I am in the middle of theme development which has specific layouts for mobile, I built a custom function to detect mobile and load mobile specific layouts in mobile view ports. Here is the ...
0
votes
0answers
35 views

How to parse a post and change the way a gallery item is rendered?

I want to use this plugin http://final-tiles-gallery.com/index.html to display the gallery the users insert in their posts, for that I need to use an specific HTML structure so the plugin works, I've ...
0
votes
0answers
160 views

Load a single post into a modal

Another one for you guys. I'm trying to load single.php into a modal. It loads, but then it loads the content into the target to open the modal. The Call: <a href="<?php the_permalink(); ...
0
votes
0answers
25 views

Previous Next Post Link by Post Rank Value Stored in Another Table

I'm using the Q2W3 WordPress plugin to sort posts by category. This plugin allows a drag-drop interface to change the default post order and modifies the standard taxonomy output so that posts on the ...
1
vote
2answers
2k 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 ...
6
votes
4answers
10k views

How to check if the product is in a certain category on a single-product.php in Woocommerce?

How in the world can I check if a product is in a certain product category on the single-product.php? <?php if (is_product_category('audio')) { echo 'In audio'; ...
0
votes
2answers
29 views

Best way to allow for extended use of Wordpress functions inside single.php

I am building a more-or-less distinguishing layout which forces me have a header far above the content in the DOM. A structure as follows: <?php get_header(); ?> <div id="wrapper"> ...
0
votes
2answers
74 views

Blog post - single.php url

I have a simple blog page that just lists blog posts on a page called 'news' http://my-site.co.uk/news I have a single.php page to display the actual post when it is clicked on 'news' The ...
0
votes
0answers
23 views

Is it possible to show actual breadcrumb to the page?

For example user search any thing in post like "Hello", then result will shown on search page matching with "Hello". When some one click on any of result, there is a breadcrumb which navigates upto ...
0
votes
1answer
105 views

Content-single.php inside my plugin

I have implemented inside my plugin this hook to change the single template for custom post type (I do not want it to be in the child theme, just in my plugin) and it works just fine. Now I want to ...
1
vote
0answers
35 views

Issue on single.php pagination WordPress

I faced weird issue on single.php. I used previous_post_link('%link', 'Previous'); and next_post_link('%link', 'Next'); for next previous in single.php, it's working perfectly, but its work on all ...
0
votes
1answer
23 views

trying to show single post but displays all post on a custom post type

Good day, I was trying to show a specific post when a user click on the title but all other post are shown as well, how can I filter it? for example when I click link ...
0
votes
1answer
61 views

Custom post template for particular posts

I am building a site that is somewhat of a mix between a directory and a blog. Some posts are to be typical blog posts with text and images, without any particular structure. Other posts, however, are ...
4
votes
4answers
4k 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
2answers
126 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
0answers
14 views

how to put signature after a plugin output [duplicate]

Hello Im Wordpress newbie:) and I have a problem with it: On single-post page, there is signature displayed (value of bibliographical info field of profile) and after there are some sharing buttons ...
0
votes
0answers
49 views

Page Templates Used in Custom Post Type

The same question was asked here with no real response. They claim it's not possible but I have used plugins that accomplish this. In WordPress I am having a problem figuring out how to use the ...
0
votes
1answer
46 views

Highlight archive link on single.php

exist some chance to highlight archive link in classic wp archive widget on single.php template? I have the same template for archive.php and single.php where I call <?php wp_custom_archive(); ...
0
votes
2answers
179 views

Hide Selection of Text From Archive, but Show on Single Posts

I'm looking for a shortcode similar to this: [hidetext]some text to hide[/hidetext] Then what will happen is that the the tag will hide the text from any page that isn't the Single Post page. Only ...
0
votes
0answers
25 views

Single page of CPT

I'm trying to create a single page of a CPT. My cpt: <?php // CONVENZIONI CPT + TAXONOMY function cpt_convenzioni() { $labels = array( 'name' => _x( 'Convenzioni', ...
0
votes
1answer
336 views

Thumbnail With Next/Prev Links Not Showing Next Post?

I am using the below code to display thumbnail with next/prev posts links on single.php page. It is working fine when next and prev post are from same category but not showing the next or prev post ...
0
votes
2answers
236 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
2answers
167 views

Cant get paginations on single.php to work with my custom post types

I'm using custom post types and custom fields plugins for my custom post types. I have all other paginations working smoothly on my website except for my single.php. I have a custom post type of ...
0
votes
1answer
657 views

Need post_type_archive_title function but in 'single'

I'm trying to pull a custom post type name/title out for use in the breadcrumb of a single-[cpt].php template file. In the archive-[cpt].php I can use post_type_archive_title() and it echo the name. ...
0
votes
2answers
1k 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 ...
1
vote
2answers
150 views

“next_posts_link” and “previous_posts_link” display me NOTHING

I'm trying to add links "Previous Post" and "Next Post" in my single.php file without success because previous_posts_link and next_posts_link dont return anything. Honestly I do not know where in the ...
0
votes
1answer
71 views

get_term_link is Ending to single.php

I have a template like this: page-movie.php taxonomy-movie.php taxonomy.php and I am using the get_term_link() at page-movie.php to list and link from the indexed page into List of all Custom ...
0
votes
2answers
100 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: ...
0
votes
2answers
111 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 ...