WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Instagrabber
[resolved] Customise post output (4 posts)

  1. Mic_H
    Member
    Posted 1 year ago #

    Been trying to customise what is generated when you use the_content(); with Instagrabber.

    At the moment it generates:

    - The Image
    - The heading
    - A link to instagram.

    What I would like to do is have it:

    - Display just the image with no heading.
    - Link to the permalink instead of to instagram

    Any suggestions on how to achieve this?

    Really like this plugin by the way, I just wish I could figure this out

    http://wordpress.org/extend/plugins/instagrabber/

  2. Johan Ahlbäck
    Member
    Plugin Author

    Posted 1 year ago #

    Interesting! Im looking at it now

  3. Johan Ahlbäck
    Member
    Plugin Author

    Posted 1 year ago #

    Your problem is related to the theme you are using. You can choose other way to do this. Create a new template files for this and leave out the title and use get_the_post_thumbnail( $post_id, $size, $attr ); to get the images for instagrabber.

    In your other thread you are creating a new loop so im gonna use it here to demonstrate how you can achieve this.

    <?php query_posts('post_type=images'); ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    <div class="post-image" id="post-<?php the_ID(); ?>">"><?php echo get_the_post_thumbnail( get_the_ID(), array( 300, 300 ) );  ?></div>
    
    <?php endwhile; ?>
    <?php else: ?>
    <h2 class="main-h2">Images</h2>
    <h2>No Content</h2>
    <?php endif; ?>
    

    array( 300, 300 ) means the image will be 300x300 pixels

    if you want to display the caption yo can use <?php instagrabber_image_caption(); ?>

    If you dont have the image saved in featured or both (only content) you may have to get the image like this:
    change this:

    <div class="post-image" id="post-<?php the_ID(); ?>">"><?php echo get_the_post_thumbnail( get_the_ID(), array( 300, 300 ) );  ?></div>

    to this:

    
    <div class="post-image" id="post-<?php the_ID(); ?>">"><img src="<?php instagrabber_image_url(); ?>" width="300">
    <p>
    	<?php instagrabber_image_caption(); ?>
    </p>
    </div>
  4. Mic_H
    Member
    Posted 1 year ago #

    Really big thank you Johan.

    <?php instagrabber_image_url(); ?>

    This has worked for me great.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic