• Hi,
    Anyone have any idea about splitting the_content? What I want to do is split each post into 2 columns and have a an image on one side, and then the , title, text (or exerpt) and meta on the other. A bit like:

    https://www.itsnicethat.com/

    All I’ve managed to find so far is information on splitting pages not posts.

    Thanks,
    Mark

Viewing 5 replies - 1 through 5 (of 5 total)
  • I could also use some help on this one.

    Hi,
    I’m no wordpress expert but I’ve managed to achieve this by using custom fields on the post.

    Have a look at this link – its really helpful.
    https://codex.www.ads-software.com/Using_Custom_Fields_to_attach_images,_links_or_files_to_a_post_easily

    Hope that helps.
    Dan

    hey Mark,

    a simple way to do so it’s to get the first image attached to your post with a function :

    function get_first_attachment() {
    	global $post;
    
    	$id = $post->ID;
    	$attachments = get_children( array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'DESC', 'orderby' => 'menu_order ASC') );
    	$tpl = get_bloginfo('template_url');
    	$nothing = $tpl.'/nothing.jpg';
    
    	if ( empty($attachments) )
    		return $nothing;
    
    		foreach ( $attachments as $id => $attachment )
    			$link = wp_get_attachment_url($id);
    		return $link;
    }

    paste this in your function.php template file, then simply create your html template page with it:

    <!– put this inside the loops –>
    <div class=”alignleft”><img src=”<?php echo get_first_attachment(); ?>” width=”150″ height=”150″></div>
    <div class=”alignright”>
    <!– your title, text and meta goes here –>
    </div>

    that is the principle…it took the first attachment linked to your post (no need to put it on the post body, just upload it and keep it in the gallery) and return it separatly.

    a simpler way to do so is to use Press75 Simple Post Thumbnails plugin

    First gives you more control, second ask you less mind effort,

    up to you, cheers,

    KL

    Hi KL,

    This is just what I was looking for, thanks. I have tried several plugins, as you suggested in your post, but had issues with upgrading WP and the RSS feeds.

    Which leads me onto my question…

    How do I output the first image’s url using your method so it is parsed into the CDATA for my RSS feed?

    Thanks

    D

    I want something like this aswell. The code that kevinlanteri supplied works flawless. However, I would also like the possibility to add video (from vimeo or such) and most importantly, this portfolio plugin:
    https://www.ads-software.com/extend/plugins/portfolio-slideshow/

    I messed around some, but I don’t really know PHP so couldn’t get it to work. Maybe there is some easier way to fix this? Anyone?

    I realize this is kind of a big request, but all help is appreciated

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Split post into two columns… Image left /Text & meta right’ is closed to new replies.