Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1134933
    daviddunnington
    Participant

    Morning Guy’s

    I have created an image gallery on a portfolio page however on the archive page I cant click through to the portfolio item. The same thing happens on one of the demo sites http://demo.theme.co/icon-10/creative/ if you scroll down to the bottom you should see the portfolio item with the image gallery. Can I ask is there a way to make it possible for this to be clickable to open the portfolio item page?

    #1134943
    daviddunnington
    Participant

    I have attached an image for you

    #1135142
    Paul R
    Moderator

    Hi,

    The gallery is only meant to show images in a slider.

    To link it to your portfolio item, you can add this in your child theme’s function.php file.

    
      function x_featured_gallery() {
    
        $stack     = x_get_stack();
        $thumb     = get_post_thumbnail_id( get_the_ID() );
        $fullwidth = ( in_array( 'x-full-width-active', get_body_class() ) ) ? true : false;
    
        $args = array(
          'order'          => 'ASC',
          'orderby'        => 'menu_order',
          'post_parent'    => get_the_ID(),
          'post_type'      => 'attachment',
          'post_mime_type' => 'image',
          'post_status'    => null,
          'numberposts'    => -1,
          'exclude'        => $thumb
        );
    
        $attachments = get_posts( $args );
    
        if ( $attachments ) {
          echo '<a href="'.esc_url( get_permalink() ).'"><div class="x-flexslider x-flexslider-featured-gallery man"><ul class="x-slides">';
            foreach ( $attachments as $attachment ) {
              echo '<li class="x-slide">';
                if ( $fullwidth ) {
                  echo wp_get_attachment_image( $attachment->ID, 'entry-fullwidth', false, false );
                } else {
                  echo wp_get_attachment_image( $attachment->ID, 'entry', false, false );
                }
              echo '</li>';
            }
          echo '</ul></div></div>';
        }
    
      }
    

    Hope that helps.

    #1136487
    daviddunnington
    Participant

    Thanks for the reply works perfectly just had to remove the last div tag to stop the layout been messed up.

    The support is very impressive guys Thank You 🙂

    #1136534
    Rue Nel
    Moderator

    You’re welcome! We’re happy to help you out.
    If you need anything else we can help you with, don’t hesitate to open another thread.

  • <script> jQuery(function($){ $("#no-reply-1134933 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>