WordPress.org

Ready to get started?Download WordPress

Forums

Gallery to Slideshow
[resolved] How do I display Images as full width? (7 posts)

  1. andyboston
    Member
    Posted 2 years ago #

    Hi,
    I want to display the images at their original size 980px wide but there seems to be a restriction of some sort.

    The css says img is set to 100% and i can't see any padding or conflicts?!?!?

    Anyone got a clue?

    http://wordpress.org/extend/plugins/gallery-to-slideshow/

  2. Matt
    Member
    Plugin Author

    Posted 2 years ago #

    Hi Andy,

    Any chance you can show us a link?

    Kind Regards!

  3. andyboston
    Member
    Posted 2 years ago #

    Hi Matt,

    It's only local at the moment but I'll upload it to a test site.

  4. andyboston
    Member
    Posted 2 years ago #

    Ok, I've put it on http://www.barbikyoo.com

    If you right click to view the image it comes up full size??
    Please let me know what you think

  5. Matt
    Member
    Plugin Author

    Posted 2 years ago #

    Hi Andy,

    Thanks for the link. You can either modify that option via the shortcode attribute "size" like this:

    [gallery size="full"]

    Or, better yet, via this little snippet that you have to paste in your theme's functions.php file:

    function yourprefix_theme_setup(){
        add_action('mv_gallery_to_slideshow_attr', 'yourprefix_gallery_to_slideshow_attrs');
    }
    add_action('after_theme_setup','yourprefix_theme_setup');
    
    function yourprefix_gallery_to_slideshow_attrs( $attr ) {
        $attr['size'] = 'full'; // or any other registered size
        return $attr;
    }

    Kind Regards!

  6. lsterling03
    Member
    Posted 2 years ago #

    Hello - I'm trying to do something similar - I've registered an image size "slider" in my functions file. I tried adding the above code and it's not working. I think it's because I'm supposed to change "yourprefix", which appears to be "pp" based on what I've seen in front of some of other things. But I'm not sure?

    It works if I manually add it to the short code with size="slider" - but I don't want to have to do that every time.

    Here is the code I'm using in my functions.php file:

    if ( function_exists( 'add_image_size' ) ) {
    	add_image_size( 'slider', 616, 240, true );
    	add_image_size( 'blog', 410, 9999 );
    }
    
    function pp_theme_setup(){
        add_action('mv_gallery_to_slideshow_attr', 'pp_gallery_to_slideshow_attrs');
    }
    add_action('after_theme_setup','pp_theme_setup');
    
    function pp_gallery_to_slideshow_attrs( $attr ) {
        $attr['size'] = 'slider'; // or any other registered size
        return $attr;
    }

    Thank you!

  7. Matt
    Member
    Plugin Author

    Posted 2 years ago #

    Hi lsterling03,

    Looks good. Try hooking the pp_theme_setup function on the init hook rather than the after_theme_setup.

    Kind Regards!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic