WordPress.org

Ready to get started?Download WordPress

Forums

Dynamic Featured Image
[resolved] Is there a way to obtain url of featured image url (6 posts)

  1. clestcruz
    Member
    Posted 6 months ago #

    Basically i'm trying to develop a post with a fancybox option feature.

    My approach is that i will set to featured images(Featured Image 1 and Featured Image 2). Once i click on featured image 1 it will display featured image 2 on a fancybox window. Is there a way to obtain the url of featured image 2.

    http://wordpress.org/plugins/dynamic-featured-image/

  2. Ankit Pokhrel
    Member
    Plugin Author

    Posted 6 months ago #

    Hi,

    Thank you for using the plugin. Yes you can obtain the url of the second image using simple array manipulation techniques.

    echo $pluginOutputArray[0]['thumb']; //will give you selected image url of first image
    echo $pluginOutputArray[0]['full']; //will give you full value of first image
    echo $pluginOutputArray[1]['thumb']; //will give you selected image url of second image
    echo $pluginOutputArray[1]['full']; //will give you full value of second image

    Thanks,
    Ankit

  3. clestcruz
    Member
    Posted 6 months ago #

    Hello ankit, i'm having a bit of a problem in displaying the second featured image on the fancybox window. Basically whenever i click the magnify button. It just displays a text and does not display the second featured image. Here is a sample of the code

    <div class="collections_dresses_container">
    
    			    <?php query_posts('posts_per_page=-1&cat=10'); if(have_posts()) : while(have_posts()) :the_post(); ?>
    		        <div class="collections_thumbnails">
    
    				  <?php if ( has_post_thumbnail()) { $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large'); echo '<img src="' . $large_image_url[0] . '" title="' . the_title_attribute('echo=0') . '">';  } ?>
    
    				  <div class="hover_dress">
    					<a class="fancybox" href="<?php echo $pluginOutputArray[0]['thumb'] ?>"><span><?php the_title(); ?></span></a>
    				  </div>
    		        </div>
    			    <?php endwhile; endif; wp_reset_query();?>
    
    		     </div>

    Here is a screenshot of what images i have placed using your plugin.
    [IMG]http://i255.photobucket.com/albums/hh140/testament1234/dynamicimage_zps906f53b1.jpg[/IMG]

  4. Ankit Pokhrel
    Member
    Plugin Author

    Posted 6 months ago #

    Are you able to display second featured image in your page? I mean outside fancybox, in your theme page?

  5. Ankit Pokhrel
    Member
    Plugin Author

    Posted 5 months ago #

    I am closing the issue because there is no any response from 2 weeks.

  6. rajbir4all
    Member
    Posted 4 months ago #

    Hello,

    I tried this echo $pluginOutputArray[0]['full']; but am getting blank value please suggest.

    getting this:
    <header class="headerinnerclass" style="background-image: url('')">

    Thanks

Reply

You must log in to post.

About this Plugin

About this Topic

Tags