WordPress.org

Ready to get started?Download WordPress

Forums

Embed Picasa Album
[resolved] pagination (12 posts)

  1. raozkardes
    Member
    Posted 1 year ago #

    Is it possible to paging album page? Having trouble with more than 200 photographs. Installing takes time.

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

  2. marchenko.alexandr
    Member
    Plugin Author

    Posted 1 year ago #

    Absolutely

    All you need to do is:

    Copy loop-picasa.php into yours theme folder and change it to something like this:

    <p>
    <?php
    $total = count($photos); // number of images
    $per_page = 6; // count of images to show per page
    $current = isset($_GET['picasa_page']) ? max(1, intval($_GET['picasa_page'])) : 1; // current page number
    
    // render pager http://codex.wordpress.org/Function_Reference/paginate_links
    echo paginate_links( array(
    	'format' => add_query_arg('picasa_page', '%#%'),
    	'current' => $current,
    	'total' => round($total / $per_page)
    ) );
    ?>
    </p>
    
    <ul class="embpicasa">
    <?php for($i = $current; $i < $current + $per_page; $i++): $photo = $photos[$i];?>
    	<li>
    		<a title="<?php echo $photo['title']?>" rel="lightbox[<?php echo $id?>]" target="_blank" href="<?php echo $photo['fullsize']?>">
    			<img src="<?php echo $photo['thumbnail']?>" alt="<?php echo $photo['title']?>" />
    		</a>
    	</li>
    <?php endfor;?>
    </ul>

    Will add it to plugins FAQ

  3. raozkardes
    Member
    Posted 1 year ago #

    I thank you.

    shown in the bottom of the page pagination?

  4. marchenko.alexandr
    Member
    Plugin Author

    Posted 1 year ago #

    No it will be shown at top, if you want to show it also at bottom just copy paste pager pargraph after gallery something like this:

    <?php
    // preparations
    $total = count($photos); // number of images
    $per_page = 6; // count of images to show per page
    $current = isset($_GET['picasa_page']) ? max(1, intval($_GET['picasa_page'])) : 1; // current page number
    ?>
    
    <!-- Top pager -->
    <p>
    <?php
    echo paginate_links( array(
    	'format' => add_query_arg('picasa_page', '%#%'),
    	'current' => $current,
    	'total' => round($total / $per_page)
    ) );
    ?>
    </p>
    <!--/ Top pager -->
    
    <!-- Gallery -->
    <ul class="embpicasa">
    <?php for($i = $current; $i < $current + $per_page; $i++): $photo = $photos[$i];?>
    	<li>
    		<a title="<?php echo $photo['title']?>" rel="lightbox[<?php echo $id?>]" target="_blank" href="<?php echo $photo['fullsize']?>">
    			<img src="<?php echo $photo['thumbnail']?>" alt="<?php echo $photo['title']?>" />
    		</a>
    	</li>
    <?php endfor;?>
    </ul>
    <!-- Top pager -->
    <p>
    <?php
    echo paginate_links( array(
    	'format' => add_query_arg('picasa_page', '%#%'),
    	'current' => $current,
    	'total' => round($total / $per_page)
    ) );
    ?>
    </p>
    <!--/ Gallery -->
    
    <!-- Bottom pager -->
    <p>
    <?php
    echo paginate_links( array(
    	'format' => add_query_arg('picasa_page', '%#%'),
    	'current' => $current,
    	'total' => round($total / $per_page)
    ) );
    ?>
    </p>
    <!--/ Bottom pager -->

    Feel free to experiment with your template

  5. raozkardes
    Member
    Posted 1 year ago #

    paging can not be displayed in the right place. I want to display pagination at the bottom of the page.

    Thank you for your help and understanding.

  6. marchenko.alexandr
    Member
    Plugin Author

    Posted 1 year ago #

    just style it as you need

    add position:relative to page container
    and position:absolute;bottom:0;left:0

  7. raozkardes
    Member
    Posted 1 year ago #

    position:relative
    position:absolute;bottom:0;left:0

    style code where you figure out how to get it.

    style.css loop-picasa.php

  8. marchenko.alexandr
    Member
    Plugin Author

    Posted 1 year ago #

    can you post your site link, otherwise i can't help you acomplish your needs

  9. raozkardes
    Member
    Posted 1 year ago #

    Hi, site link http://nikferim.com/nikferli/?p=1624

    another plugins,kpicasa gallery pagination demo, http://nikferim.com/nikferli/?p=1647

  10. marchenko.alexandr
    Member
    Plugin Author

    Posted 1 year ago #

    Try to add to your styles.css following:

    .embpicasa {
        display: block;
        clear: both;
        overflow: hidden;
    }
  11. raozkardes
    Member
    Posted 1 year ago #

    Thank you. It was like I wanted. Participate in a more stylish look with CSS paging. Hope to see you for the next version.
    Thank you for your help.

  12. raozkardes
    Member
    Posted 1 year ago #

    Paged 1 Clicking the page does not open. No problem with the transition to the other pages. 1 does not jump to the page. One solution is to be found?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.