WordPress.org

Ready to get started?Download WordPress

Forums

Theme with just image on home? (12 posts)

  1. csgillis23
    Member
    Posted 1 year ago #

    I've looked everywhere and haven't been able to find or tweak a theme to just have a static image on the homepage.

    I just want to:

    1. Post blog post with an image
    2. Have that show up on homepage
    3. User can click that image to get to the previous post
    4. The image will be left justified in the browser

    Any ideas?

  2. esmi
    Forum Moderator
    Posted 1 year ago #

    You should be able to do this by tweaking just about any theme and using the post thumbnail and possibly add_image_size if you want a large image on the front page.

  3. csgillis23
    Member
    Posted 1 year ago #

    Thanks esmi - I just downloaded the bones theme and am tweaking that - do you know how I can link the image (post) so it always goes to the previous one?

  4. esmi
    Forum Moderator
    Posted 1 year ago #

    Sorry _ I may have misunderstood you initially (the brain is not working at 100%). You want one post on the front (main posts) page and then a image navigation links that leads to the previous post, yes?

    How many post will be on subsequent pages?
    Will you also want an image link for someone to move forward to the next post when they are on page 2 or 3 etc?

  5. csgillis23
    Member
    Posted 1 year ago #

    no problem I appreciate the help.

    I just need the image to be the post. That shows on the homepage. When a user click that photo they are taken to the previous post.

    So somehow I just need to image to link to the previous post in the PHP (which I'm a total hack)

  6. esmi
    Forum Moderator
    Posted 1 year ago #

    Something like:

    $prev_post = get_previous_post();
    if (!empty( $prev_post )): ?>
    <a href="<?php echo get_permalink( $prev_post->ID ); ?>"><?php the_post_thumbnail(); ?></a>
    <?php endif;

    within the Loop might work.
    http://codex.wordpress.org/Function_Reference/get_previous_post

  7. csgillis23
    Member
    Posted 1 year ago #

    I'm almost there - take a look here http://formfold.com - it's showing as a title of the blog post.

    I also can't figure out how to get rid of the sidebar on the bones theme? huh.

  8. esmi
    Forum Moderator
    Posted 1 year ago #

    Try removing the eightcol class off the div#main.

  9. csgillis23
    Member
    Posted 1 year ago #

    I'm still having issues with this - anyone have ideas - here is the php code:

    <div id="main">
    
    					    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    						<?php $prev_post = get_previous_post(); if (!empty( $prev_post )): ?>
     						 <a href="<?php echo get_permalink( $prev_post->ID ); ?>"><?php echo $prev_post->post_title; ?></a>
    
    					    <article id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?> role="article">
    
    						    <section class="entry-content clearfix">
    							    <?php the_content(); ?>
    						    </section> <!-- end article section -->
    
    						    <?php endif; ?>
    
    						    <footer class="article-footer">
    
        							<p class="tags"><?php the_tags('<span class="tags-title">Tags:</span> ', ', ', ''); ?></p>
    
    						    </footer> <!-- end article footer -->
    
    						    <?php // comments_template(); // uncomment if you want to use them ?>
    
    					    </article> <!-- end article -->
  10. alchymyth
    Forum Moderator
    Posted 1 year ago #

    there is an endif somewhere in the middle of article, and no endwhile and endif of the loop (?)

    please use the pastebin to paste the full code of the template - http://codex.wordpress.org/Forum_Welcome#Posting_Code

    you also might need to adjust the css to center and/or stretch the image...

  11. csgillis23
    Member
    Posted 1 year ago #

    sorry about that - here is the code from my index.php

    http://pastebin.com/g97zuwhW

    ya I'll need to fix the css def and will mess with that once I figure out this php stuff :)

  12. alchymyth
    Forum Moderator
    Posted 1 year ago #

    this is where I would add the 'endif':

    http://pastebin.com/WEsbukqG

Topic Closed

This topic has been closed to new replies.

About this Topic