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

learn more… | top users | synonyms

1
vote
2answers
936 views

Insert After Second Paragraph Without <P> Tag?

I use a code like the one shown below to insert ads after the first paragraph. The problem is that this code requires the content to be displayed within paragraph tags and I would like to use this ...
0
votes
0answers
9 views

Grabbing Custom Single Post Template displays WSOD

I'm trying to use a custom Single Post Template & call it via my single.php (It wasn't drawing from single-press.php otherwise) My main goal is to have the Custom Single Posts not display the ...
0
votes
1answer
18 views

Custom Single Post Type not referring to single-post-type.php File

I've defined a Custom Post type called "Press", I'm trying to modify the Single Posts template for that Custom Type. The single posts custom file is called "single-press.php" I've tried using an if ...
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
1answer
367 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 ...
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 ...
3
votes
2answers
5k views

How to detect single.php (but not single-portfolio.php)?

When I'm using is_single(); in my <head> section to add some style to website navigation it executes correctly on blog posts but it also executes on single "portfolio" post type posts (so ...
0
votes
1answer
536 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 ...
1
vote
1answer
27 views

Post Rank on Single Post page based on custom field

As per my previous question. How to show posts rank based on custom field value It works perfect on homepage as I wanted. Now I want to show the same rank in single post pages also.
0
votes
1answer
20 views

Different post into a single page

i am having a little trouble here. Well what i am exactly trying to do is post posts into different divs in my wordpress template in a single page. How am it to achieve different posts in different ...
0
votes
0answers
23 views

does it need any special functions to write in function.php?

does it need any special functions to write in function.php of template for single-{post_type}.php? I created a custom theme , but it does not move the single-{post_type.php}, my page is ...
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' ); ?> ...
0
votes
2answers
730 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
27 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
126 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
0answers
108 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 ...
0
votes
0answers
46 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
223 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
58 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
34 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
39 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
36 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
30 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
32 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
603 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
89 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
21 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
52 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
48 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
193 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
33 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
86 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
24 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
115 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
36 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
74 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
5k 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
135 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
66 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
50 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
181 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
26 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
386 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 ...