• Hi all,

    I have just moved over to WordPress from another Open Source CMS. I was wondering how I might format my blog entries differently. It is quite hard to explain, so I have attached a screenshot of my mockup.

    https://i276.photobucket.com/albums/kk25/leewilson78/blog_03.jpg

    The image of the photographer on the left, this will be the size of all images that I will add to each entry, the image of course will need to be different.

    Is there a way of laying it out this way in WP?

    Thanks

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter leewilson78

    (@leewilson78)

    Anyone ??

    Hi Lee,
    you can use custom fileds for this purpose. Each post or page has a custom field. Towards the bottom of your post writing page, you will find an area named Custom Fields with a “Name” and a “Value” fields. You can specify in the “Name” field a name for your custom field. The “Value” should contain the name of your image file (you can also include the full path).
    You then use the “Name” in your index page loop.

    I will explain more later. but you can search https://www.ads-software.com/doc on using Custom Fields

    [signature moderated Please read the Forum Rules]

    Thread Starter leewilson78

    (@leewilson78)

    Thanks for the help, looking forward to seeing your theme.

    Hi Lee,
    you can define your custom fields in the Admin mdoule in either the Page create/edit page or Post create/edit page. There is a section titled Custom Fields where you candefine your custom fields by giving them a name and a value. The name and value can later be used in your posts loop script as follows:

    e.g. Custom Field Name: my-field
    Custom Field Value: thumbnail.jpg

    your code in the post Loop would be:

    <div id="content" class="narrowcolumn" role="main">
    	<?php if (have_posts()) : ?>
    		<?php while (have_posts()) : the_post(); ?>
    			<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
    				<div class="thumbnail">
    					<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><img src="<?php bloginfo('template_url') ?>/images/<?php echo get_post_meta($post->ID, 'my-field', true); ?>" width="200" height="200" alt="Post Image" /></a>
    				</div><!-- thumbnail ends -->
    				<div class="entry">
    					<h1 class="post-title"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>
    					<small class="post-info"><strong>Posted: </strong><?php the_time('F jS, Y') ?> in <?php the_category(', ') ?> by <?php the_author() ?></small>
    					<div class="post-desc">
    						<?php the_content('Read More') ?><span class="post-comments"><?php comments_popup_link('0 Comments', '1 Comment', '% Comments'); ?></span>
    					</div>
    				</div>
    		</div><!-- post ends -->
    		<?php endwhile; ?>
    		<div class="navigation">
    			<div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
    			<div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
    		</div>
    	<?php else : ?>
    		<h2 class="center">Not Found</h2>
    		<p class="center">Sorry, but you are looking for something that isn't here.</p>
    		<?php get_search_form(); ?>
    	<?php endif; ?>
    	</div><!-- content ends -->

    [signature moderated Please read the Forum Rules]

    Thread Starter leewilson78

    (@leewilson78)

    Great info, I’m gonna look into this.

    Thanks

    Thread Starter leewilson78

    (@leewilson78)

    This is fantastic, custom fields… genius. The feature has given me endless possibilities for my layout… nice.

    Thread Starter leewilson78

    (@leewilson78)

    I have got this working great for the single page, but within the index page it display the same image for every post, is there someone else I need to place it.

    Basically, I have a thumbnail image on the main blog page and a full size image on the single article page.

    So, I have two custom fields, one name thumbnail and one named full size, I have called the thumbnail from within the index page.

    Appreciate any help.

    Thanks

    Thread Starter leewilson78

    (@leewilson78)

    Any ideas?

    Hi Lee,
    Sorry I was busy with my new theme for https://flashjourney.com/ just finished it and now tweaking it to work with ie 5,6 and 7.

    You can have many custom fields for the page, post .. etc.

    You can assign a different value for a specific post custom field to display different images for each article and that’s the idea.

    The way I am using this in the new theme is for each post I upload an image and then save it in the uploads folder. Then I take the URL of the uploaded image and paste it in the Custom Field Value for that post.

    You can see this in action in few days time when I upload the new theme for https://flashjourney.com/ so keep checking.

    MAD

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Seperating image from content’ is closed to new replies.