Support » Plugin: WP Photo Album Plus » Latest photo – latest album

  • Resolved bodzio16

    (@bodzio16)


    Hello!

    is there a way to add a random photo from the latest added album with php, like

    <?php echo wppa_albums(); ?>

    Thank for help.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Jacob N. Breetvelt

    (@opajaap)

    To make it a bit more simple, i added a new function to the code. This function will remain in future versions. To use it now, update to the current development version 6.6.07.002, See: http://wppa.nl/docs-by-subject/development-version/ for instructions.

    After that, put in the page template:

    
    <?php
    if ( function_exists( 'wppa_get_random_photo_id_from_youngest_album' ) ) {
    	$photo = wppa_get_random_photo_id_from_youngest_album();
    	if ( $photo ) {
    		echo wppa_insert_shortcode_output( do_shortcode( '[wppa type="photo" photo="' . $photo . '"][/wppa]' ) );
    	}
    }
    ?>
    

    This will do the job. If the youngest album does not have any photos, it will use the previous youngest album, etc.

    You can change the shortcode [wppa type="photo" photo="' . $photo . '"][/wppa] as you like ( add optional size="..." and align="..." as you like, or e.g. change type="photo" into type="mphoto" ) as long as you keep photo="' . $photo . '" intact.

    For more shortcode options see: http://wppa.nl/shortcode-reference/

    Thread Starter bodzio16

    (@bodzio16)

    Thanks, will check it ASAP.

    Thread Starter bodzio16

    (@bodzio16)

    I am trying to work this out to make the photo to be a link to the album itself. I tried the generator, but with no results. Any hints? 🙂

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    If you have type="photo" in the shortcode, set the linktype in Table VI-B3a
    If you have type="mphoto" in the shortcode, set the linktype in Table VI-B4a
    If you have type="xphoto" in the shortcode, set the linktype in Table VI-B4.1a
    and select – on the same line – a landing page where to display it. A landing page must have a wppa shorrtcode ( preferrably: [wppa type="landing"][/wppa] ) in its content.

    Thread Starter bodzio16

    (@bodzio16)

    I did change the link type, made the anding page, but still the image is not linked.Tried with single photo, mphoto etc.

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    Can you give me a link to the page, a screenshot of Table VI-B and the shortcode you use?

    Thread Starter bodzio16

    (@bodzio16)

    http://www.bonjovi.pl/galeria/

    https://www.dropbox.com/s/bcdijukh9vgmuq8/Schowek02.jpg?dl=0

    <?php
    if ( function_exists( 'wppa_get_random_photo_id_from_youngest_album' ) ) {
    	$photo = wppa_get_random_photo_id_from_youngest_album();
    	if ( $photo ) {
    		echo wppa_insert_shortcode_output( do_shortcode( '[wppa type="mphoto" photo="' . $photo . '" size="250" align="right"][/wppa]' ) );
    	}
    }
    ?>

    It gives a link in the code, but it is not clickable. Maybe it can’t be a self landing page?

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    There is a second item on top of the first. Add <div style="clear:both" ></div> as follows:

    
    <?php
    if ( function_exists( 'wppa_get_random_photo_id_from_youngest_album' ) ) {
    	$photo = wppa_get_random_photo_id_from_youngest_album();
    	if ( $photo ) {
    		echo wppa_insert_shortcode_output( do_shortcode( '[wppa type="mphoto" photo="' . $photo . '" size="250" align="right"][/wppa]' ) );
    		echo '<div style="clear:both;" ></div>';
    	}
    }
    ?>
    
    Thread Starter bodzio16

    (@bodzio16)

    Works fine, but the cursor in not the hand pointer, can I edit it somewhere in css?

    Also, is there a way to get the last modified category name?

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    the cursor in not the hand pointer

    This is a bug that will be fixed in the next version. Thanx for noticing.

    is there a way to get the last modified category name

    No, there is not.

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    Fixed 6.6.08

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Latest photo – latest album’ is closed to new replies.