• Hi–

    I really am having some trouble finding code to do the following:

    I want each post to appear with the following info on the front page:

    1) Date/Time
    2) Category (with link to category)
    3) Contributed by Author (with link to author’s posts)
    4) Title of post (with link to view the ENTIRE post)
    5) A “read more” inserted immediately into each new post, that links to the full post

    And that’s it. I want to hide all content on the main page so that I can list new posts cleanly and clearly, but utilize each post with automatic permalinks, so that people can just click the “read more”, or the posts title, and read all the content.

    I know about the more tag, however it seems if I use that I have to use it manually on each post. I just want something built into the template index so that each new post has this info above built in.

    Any ideas? does anyone have any code that can do this for me?

Viewing 6 replies - 1 through 6 (of 6 total)
  • If you delete the_content tag from your index.php that will do it.
    Warning: To make it work properly, you will have to have all the necessary other template files in the theme, otherwise it will never display anything.
    See Template_Hierarchy.

    Thread Starter badkarma9000

    (@badkarma9000)

    I think my problem is I’m missing some of the other files in the heirarchy, hence it never showing anything… Can I just import the single post php file into my other theme? or is there something else I have to do?

    You can create as many template files as you wish – based on the list in the codex; i.e. files with names that WP recognizes as “templates”. (Probably the best way is to look at the default theme, it has almost all the necessary files).
    You can “import” a file from another theme – the only question is whether the layout, the div id’s and classes are the same or not.
    You can also save the theme’s index.php (before altering it, of course!) as single, page etc. and make the necessary editing to them.

    Thread Starter badkarma9000

    (@badkarma9000)

    Awesome, I think this will work great! Thanks for the help!

    And if you want to see how the templates work together, take a look at my visual anatomy.

    Thread Starter badkarma9000

    (@badkarma9000)

    I’m using Iridium as my theme, and they didn’t include a single.php file… So while I think this will work, I’m having to do tons of changes in order to make the theme come up the right way in the single.php file.

    Right now the header and the left bar aren’t coming up with the same spacing as they do in the main template file, so it’ll take me a bit to figure out where the differences are.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Hide Content on Main Page, but Not on Post’ is closed to new replies.