Tagged Questions

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

learn more… | top users | synonyms

0
votes
1answer
25 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
86 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
2answers
66 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
69 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 ...
1
vote
2answers
26 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 ...
-1
votes
0answers
32 views

Function to remove all classes on images [on hold]

I need to remove css style by the_content single.php Example single.php img src="http//image1" alt="" class="mycss" /> (remove alignnone size-medium wp-image-51) img src="http://image2" alt="" ...
0
votes
1answer
22 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
39 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
44 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
0answers
12 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
28 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
43 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
92 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
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. ...
0
votes
1answer
26 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
25 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
72 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
27 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
32 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
36 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
0answers
72 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
27 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
195 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
59 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
54 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
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
2answers
76 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
26 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
58 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
137 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
42 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
96 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
46 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
91 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
74 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
38 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
45 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
38 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
37 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
71 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
37 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
79 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
108 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
301 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
72 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
86 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
80 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"> ...