Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Post area not linking to posts

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #43242
    Jeager
    Member

    I feel like this is just something I am not thinking of, like having a post.php file or something.

    I have been working all night and pretty out of it, but made some leaps and bounds. I have been working on my portfolio site locally so that when I redo it later I will know what I am doing.

    Right now this is it: http://jtpenezich.com/

    However I am changing things up for when I remake it. Currently my index.php contains a hook to a template page and a custom query loop to grab all my other pages I want displayed normally (one long site).

    My template page has 2 loops in it. These loops allow me to make a post of an image that I want to add to my portfolio. This in turn will be sucked onto the main page (via get_template) and display a thumbnail of the image (via post_thumbnail). This way I no longer need to manually crop a thumbnail, add it to the page, add a link, and then it would only be linked to the image, not the site.

    How I have it now in the template file:

    while($custom_query->have_posts()) : $custom_query->the_post(); ?>



    As described above, the get_template grabs what this will post, the thumbnails currently, that I post in the category. This works fine (finally). However when I add a link so when you click the thumbnail to bring you to the full post, it says page not found, by using:

    “>

    Setting the permalinks back to default at least doesn’t break it, but also doesn’t display the post. I guess since there is no loop set up for them to display that. Now that I think about it, I don’t really need a template source at all. I can just put the loops back into the index.php… So what should I be doing.. That when someone clicks the thumbnail it will link to the full post?

    #127492
    TheDoc
    Member

    How many templates do you have? Generally, packing everything into index.php is a bad idea. I’m not 100% sure if you’re overloading it too much or not, since I can’t see how your theme is fully structured, but it’s something to keep in mind.

    You have so many other templates that you can use!

    Posts use single.php
    Pages use page.php
    Categories us category.php
    etc.

    You’ll want to look at this: http://codex.wordpress.org/File:Template_Hierarchy.png

    #127509
    Jeager
    Member

    I am only using my index file. 3 loops in it. Then the header/footer

    Edit: Just going to mark this solved. I just flew past making the single.php.. Forgot how magical WP was and was thinking way to deep.

    #127535
    Jeager
    Member

    Thanks yeah, I wasn’t copying my direct code, they are all inside the loops though. I honestly just forgot that WP is a wizard and automatically detects a post as a post, and therefore uses the chain of templates down to index. I cleaned things up a bit by having a front-page.php as my static page that holds my 3 loops and a single.php to hold my posts.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Back End’ is closed to new topics and replies.