Forums

[resolved] Customizing Single.php as a template for no comments (8 posts)

  1. fotofio
    Member
    Posted 9 months ago #

    My client has a need for one of the pages containing posts to present a single post view and not allow comments on the post. As single.php is that presentation page, how do I arrange for a customized version of single.php(sans the comments template) to be the presentation page?

    Other presentation aspects of the site blog entries do require single.php to have a comments template.

  2. figaro
    Member
    Posted 9 months ago #

    Make a copy of single.php page, rename it, and make a template out of it...see stepping into templates in the docs here. Just remove the comments code from that template.

  3. fotofio
    Member
    Posted 9 months ago #

    Yes, I did figure that part out, but how to make that newly named template page be the one that goes into action when called. I do appreciate your help on that point.

  4. figaro
    Member
    Posted 9 months ago #

    When you write a new page, you select that template -- look to the right of the page editing window.

  5. fotofio
    Member
    Posted 9 months ago #

    Let me begin again. I created a template for articles.php presenting a selection of blog entries from the specific category "articles". Articles.php, as a template does not present an opportunity for comments. However, when the visitor click as a title link, they are presented with a solitary post view, one title and its content, via single.php

    Within the WP loop, single.php is the presentation page. If I customize that, how do I link articles.php to customSingle.php for a solitary post view only from articles.php?

    Figaro, I thank you again.

  6. fotofio
    Member
    Posted 9 months ago #

    What I find in the codex regarding templates, template hierarchy, and conditional tags is not that helpful; more confusion than not. For example, It seems to be suggested that if I create a version of single.php for my need and rename it single-9.php (9 is the category ID for the two related posts I am attempting to present without comment opportunity) Then based on the query string and the fact that there is a document called single with related category number, according to template hierachy, the linked blog entry and the designated "single" should find each other.

    Is there a parent->child relationship between the page that carries three or four blog entries and the "single" that presents one of them as a selected item?

    The Loop has me spinning!

    S.

  7. plebe
    Member
    Posted 1 month ago #

    figaro, this option exists for the default template, but not for classic. Why? I've copied all the function code from default to classic, but I don't get any options for choosing templates.

    Any help appreciated. I've scoured this site.

  8. xenlab
    Member
    Posted 3 weeks ago #

    @plebe

    page templates only work for pages and not posts.

Reply

You must log in to post.

About this Topic