Tagged Questions

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

learn more… | top users | synonyms

0
votes
1answer
191 views

Set a cookie only in single posts

I'm trying to set a cookie when a user is on a single post. I'm keeping track of how many single posts he has read this month. I have two problems: I have a custom template and added the following ...
1
vote
2answers
448 views

Custom Post Templates

The Issue: I am looking for custom single post templates, to add or remove individual elements as a function of a normal single post. There are a lot of ways to create custom post templates for ...
1
vote
2answers
201 views

Restrict post navigation to current sub menu

This is what I'm using to output my post navigation: <?php if (is_single() ) { ?> <nav class="post-navigation"> <h1 class="visuallyhidden">Post Navigation</h1> ...
0
votes
1answer
4k views

Archive page for custom post type not working

I use a plugin called CPT-onomies to create Custom Post Types. I created a post type called "case", and set "Has Archive Page" to true, but when i try to view a single case, i just get 404'd. Same ...
0
votes
1answer
83 views

Parent for a single (single.php)

Is it posible to get the parent ID of an single page.... I mean not a Page I mean an is_single()... page. I have a page witch contains some custom posts and when I click on one of these i came to the ...
0
votes
1answer
33 views

Exclude single page from function

//wraps the permalink around each thumbnail add_filter( 'post_thumbnail_html', 'my_post_image_html', 10, 3 ); function my_post_image_html( $html, $post_id, $post_image_id ) { $html = '<a ...
2
votes
2answers
1k views

Related Posts by Multiple Tags?

I was curious if was possible to display related posts by multiple tags. The site I am working on has about 5 tags per post. Most posts have 1 or 2 tags in common. The related posts I'd like to show ...
0
votes
1answer
84 views

navigation link based on custom field

I'm looking for a method to order posts by a custom field so that the navigational links on a single post template would point to the next or previous post in the sequence defined by a number in a ...
0
votes
3answers
4k views

Custom post type single-{custom}.php not working

I made a custom post type with the machine name special_media_post and wordpress is simply not seeing the single-special_media_post.php. I am at a complete lose. It keeps defaulting to the index.php ...
1
vote
1answer
736 views

Using loop pagination on single.php

I want the main front-page loop to show in a section on both index.php AND single.php templates, with pagination. Pagination works fine on the homepage, but not on single posts. This is the code ...
0
votes
1answer
77 views

Custom Style per Post, How to Display Custom-Styled Single post on Homepage?

This question probably has simple answer, but I'm not an expert programmer so lemme explain my question chronologically. I apply custom style for every single post, and it works using the following ...
0
votes
1answer
2k views

Single page not working for custom post type

I created a custom post type with the following code: add_action('init', 'create_trans_career'); function create_trans_career() { //Arguments to create post type. $args = array( ...
1
vote
0answers
34 views

On single.php, fetch 2 posts created after and 2 posts created before in relation to the actual post (using menu_order)

Looking for a way to on single.php fetch and show the actual post, and then by looking on the menu_order value of that specific post (lets say the post have menu_order value 3 in this case) go and ...
0
votes
4answers
368 views

How to show single post page as home page

I want to start a funny images website but I have come across a dilemma. I want the website to display 1 post ( not the thumbnail) but the full post on the home page. (the most recent post). Similar ...
1
vote
1answer
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
1answer
362 views

How to move meta information in TwentyTwelve's single post template?

How can I move a single post's meta data to it's headline? I tried single.php and content_page.php, but could not find it. I am using the recent Wordpress 3.5.1 with the standard theme TwentyTwelve. ...
0
votes
2answers
484 views

How to use WP_Query() on single.php?

I'm using WP_Query() to pull out a few posts under a specific category "Featured" to display at the bottom of any post. So I added <?php if (function_exists('getEditorPicks')) ...
1
vote
1answer
232 views

changing permalink for custom template in posts of a certain category

I've created a unique single post template to give people the option of reading all posts of a certain category using the awesome "reveal.js" which they access via this link <a ...
1
vote
2answers
701 views

Using previous_post_link and next_post_link to wrap around post sequence

For a single custom post type, I'm using previous_post_link and next_post_link with simple arrows. (Although text arrows are shown here, in the actual I'm using graphics with the text hidden via CSS.) ...
0
votes
1answer
139 views

Single template will not show sidebar/bottom-nav and footer

Im using the blankslate template theme and have a sidebar which i would like to use throughout the website. On my sidebar on the homepage i have a widget called latest posts with the latest post ...
1
vote
1answer
875 views

Using wp_list_categories like the the_category (showing just current categories of a post)

fromi'm using wp_list_categories to get an unordered list with headlines (on single.php inside the post-loop): <ul><?php wp_list_categories('title_li=0');?></ul> the thing is: i ...
1
vote
0answers
85 views

How to make the link to the category for a post go to corresponding page number in archive?

For instance, I am at http://url.com/single-post and in the post there is a link to the category that navigates to http://url.com/category/page/3/ which is the corresponding archive page that contains ...
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 ...
1
vote
1answer
408 views

How do I display a custom field from a custom taxonomy in single.php?

I know that the following mysql query produces the exact results I wish to echo within single.php: SELECT meta_value FROM `wp_taxonomymeta` WHERE `taxonomy_id` =565 AND `meta_key` LIKE 'baseurl' ...
0
votes
1answer
166 views

explain why is_single doesn't work

I am playing around with template hierarchy. I have uploaded stock 2012 theme and deleted page.php and single.php. I found that when I visit a blog post and click the the post reply link to leave a ...
0
votes
1answer
45 views

How to make a list of posts displaying them 5 by 5 with a “next posts” link?

I have been googling for the past 2 hours and haven't been able to figure this out, mainly because I am missing the right terminology, in other words, I don't know what I want in "wordpress words". ...
0
votes
1answer
376 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 ...
2
votes
2answers
328 views

single page site with subpages

i want to make a single page site which has subpages with following structure about us team -member1 -member2 contact and i want the output to be like <div class="about-us"> team content ...
0
votes
2answers
47 views

1 post, 2 templates

I want to be able to render post in two different styles (2 templates). For example, let's say I have the post ID 133, I would like two URLS to access it and so it renders where different template ...
0
votes
1answer
187 views

Pagination issue with Single.php

I am having issues understanding the worlds most simplest concept when it comes to building a single.php file and using pagination. The code bellow shows a wordpress loop, its contents and then ...
0
votes
1answer
266 views

Single Post in Tab/Slider

I have managed to code tab system that fetches different categories and custom taxanomies on a home page and shows relative posts. Now, is it possible that when someone clicks on one of the posts in ...
0
votes
0answers
7 views

is_single query calling the wrong stylesheets? [duplicate]

Possible Duplicate: is_singular won’t call my functions? So I am trying to call different style sheets for each of my post types single page. Here is the code I am using in my header ...
0
votes
1answer
905 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 ...
1
vote
1answer
139 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 ...
0
votes
1answer
70 views

How do I get a single page navigation depending on the previous page?

I figured this would be a fairly comon thing. But I can't seem to find out how to do it. Or I'm just not using the correct search terms. I've got a website with a hompage that lists all my posts, and ...
0
votes
1answer
202 views

I would like single.php to act just like index.php

I'm creating a WordPress theme for my portfolio and I would like to my single.php file to act just like the index.php. I need the single.php to show the entire loop but if I access single post's page ...
0
votes
2answers
4k views

How to get category id in single.php wordpress?

I need to get category id in single.php. I tried this: $cat_ID = get_query_var('cat'); It didn't work. What should I use instead?
2
votes
3answers
5k 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
1answer
2k views

Changing wp_link_pages() to “Next Page” and “Previous Page” buttons?

Currently I am using <!--nextpage--> to split a post into multiple pages, but I would like to change from Pages: 1 2 3 4 to Next Page and Previous Page links similar to what you see on this ...
0
votes
1answer
124 views

How to direct user to actual 404 page when a check is false in single.php?

Can someone tell me how to direct a user to the main 404 file instead of having to print an error message saying "file not found" in single.php? For example: <?php if (!$myVar) { // go to ...
0
votes
1answer
121 views

Make Next and Previous on single-$posttype.php use the same order as archive-$posttype.php

I have a custom post type events and am displaying these events using archive-events.php and single-events.php from the template hierarchy. I have a custom query in archive-events.php $paged = ( ...
1
vote
1answer
841 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
1answer
633 views

Attachment image single page

How do I make a single post page for a single attachment image below and link to it? <?php get_header(); ?> <div id="body"> <?php if (have_posts()) : ?> <div ...
0
votes
1answer
78 views

Single file upload

I would like to allow user to only upload one file at a time using the flash uploader interface. I found around here a link to a hack allowing to generate an error message when more than one file is ...
0
votes
2answers
2k views

Custom single.php files for different post formats

I have 3 custom post formats. One is for image, one for video, and, one for gallery besides the default post and they each have a view comments link on the bottom right corner at the end of the post. ...
0
votes
1answer
206 views

Links in the_content not linked

I have alot of old posts that are being pulled with the_content() context. In the_content() there is links in the text, however none of them are hyperlinked it just shows like ...
4
votes
3answers
1k views

Posts in multiple Categories different single.php

I am smashing my head against some code. Here is the situation: I have one post in 3 different categories, this post has to be visible in "category 1" with the single1.php, in "category 2" with ...
1
vote
0answers
106 views

Adding range to wp_link_pages();

I have some very long posts, some have more than 50 pages() and when using wp_link_pages it give me 50 internal post links, clearly this isn't usable. How can I add a range to the wp_link_pages ...
0
votes
3answers
956 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 ...
1
vote
3answers
837 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 ...