• Resolved fluffage0

    (@fluffage0)


    Like the title suggests…

    How do I create a handcoded single.php

    That is… If I have a web-site created that I coded by hand, what exactly do I need to include in the content area of the page to make a single.php?

    I’ve looked at the original single.php and tried to copy and paste over what I thought I’d need, but I’m really at a loss here. I can’t figure it out.

    Could anyone help me out with this? Thank you.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Have you tried just copy and pasting the whole thing across, checking it works, then just evolving that in to what you want?

    That’s what I did on my news site.

    Thread Starter fluffage0

    (@fluffage0)

    I’m just not sure exactly what I need to copy and paste over.

    But let me try to understand what you did…

    You opened the original single.php and copied EVERYTHING and then just pasted it right in the middle of your content area?

    What about the part that looks for the theme?

    I’m pretty noobish at this :/

    Thanks for the reply ??

    Thread Starter fluffage0

    (@fluffage0)

    Bump.

    @fluffage0,

    I think you would benefit from a little reading…

    https://codex.www.ads-software.com/Blog_Design_and_Layout

    R

    Thread Starter fluffage0

    (@fluffage0)

    @r

    I don’t think any of that really covers what I need.

    I’m not using themes, and most all of that info(being very useful nonetheless)applies to themes.

    I just need to know… what exactly do I need from the original single.php to make a new hand coded single.php? What part of the code do I need in the new single.php? Do I need to make any changes to the code?

    Thanks for the link, R. I’ll be reading up on a lot of that.

    if you are using wordpress….you are using themes.

    A theme controls the look and feel of your site, single.php is part of a theme

    If you haven’t installed any themes, you are still using one….the default wordpress theme

    I’m not understanding what exactly you want? single.php is a file that controls the look and function, within your theme, of a single post

    page.php usually controls the look and function of a single page

    What are you trying to accomplish exactly? Maybe if you tell us that, we can go from there…..

    Thread Starter fluffage0

    (@fluffage0)

    Right, I understand what themes are and what they do. But I’m not using the appearance of any theme, nor do I wish to. And I’m not going to make my hand coded site a theme either.

    Like I’ve said I created a web-site, hand coded. I put the loop on the home page for news, and I also included it on another page where people will be writing articles.

    NOW… when someone clicks on the title of the post/article… OR the link to the comments, it takes them to the single post, which like you said(and I had also assumed) is controlled my single.php. I, however do not want to use the default single.php. I want to create my own.

    So using one of my own pages, I cleared the content out, opened the original single.php and copy and pasted into the content area of my site… everything from single.php that I thought I would need… And it did not work.

    So what I need to do know: what exactly do I need to copy out of the original single.php into the content area of my hand coded page so that when someone wants to read just a single post it will show that single post, but while using my own designed pages.

    Thread Starter fluffage0

    (@fluffage0)

    Bump.

    reading is always good:
    https://codex.www.ads-software.com/Theme_Development
    https://codex.www.ads-software.com/Stepping_Into_Templates

    wordpress would use index.php to show single post, as long if you don’t have a single.php.
    so, in the simplest case, copy your index.php and rename it single.php; then start to edit it to make it display what you want.

    to get on here, could you copy your index.php into a pastebin and post the link here, so we know at last what you are talking about.
    and could you describe a bit more in detail what ‘the content area’ is in your file?

    Thread Starter fluffage0

    (@fluffage0)

    So what php code is used exactly in the single.php? I see what you are saying, but I still need to know exactly what php code do I need to include in the single.php for it to display just a single post?

    My content area.. would be the area where the bulk of the content is displayed. For example.. on a blog.. the area where the actual posts are displayed at. That’s the content area. That is where I’d want my single posts to be displayed at. On the index page that is where the posts are displayed at. Like this…

    [header]
    [navigation]
    [content area]
    [footer]

    So what I need to know is exactly what php code needs to be in content area if I were to create a single.php. I need the code that would call for that single post when that page is accessed.

    i think you should open a default wordpress template
    and check the difference between the index.html
    to single.php which is usually on several lines of code

    Basicly the template is build like this

    HEADER PART

    MAIN BODY PART & sidebar included

    FOOTER..

    so when u combine this with a different design you
    need to start with embedding the header meaning title
    and description tags.. sometimes pages menu and such

    and in center page meaning MAIN BODY PART
    you place the right code that oredrs the system
    to send back information that fits the page type..

    that command and the information it returns is called
    “the loop”

    you can enter a php order to return a single post information
    or a category information or an archive infromation..

    start by checking a default template to learn the differences

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘How to create handcoded single.php’ is closed to new replies.