Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1115114
    Rish
    Participant

    Hi,

    I need to view my new recent updated posts in Ethos post carousel.

    And if its possible that the recent post can be category wise as well.
    Currently ,There are only options for Most Commented, Featured, and Random.

    I find two related posts
    https://community.theme.co/forums/topic/how-to-set-order-by-for-recent_posts/

    https://community.theme.co/forums/topic/ethos-carousel-post-slider-recent-posts-option/

    but i need the recent post in Ethos post carousel category wise.means whatever the recent updates coming in any category it will shown in the Ethos post carousel slider which running on top of the ethos site.

    #1115301
    Christian
    Moderator
    This reply has been marked as private.
    #1115312
    Rish
    Participant
    This reply has been marked as private.
    #1115470
    Christian
    Moderator

    Change it to

    <?php
        $args = array(
          'post_type'      => 'post'
        );
    ?>

    For more options, please see https://codex.wordpress.org/Class_Reference/WP_Query. Since you’re dealing with PHP here, please take note that this might break your site in case you accidentally make a syntax error. In that case, please contact a web developer to investigate the custom code.

    Thanks.

    #1116043
    Rish
    Participant

    Great Christian, You are awesome:)

    One more thing i need from you regarding php change in functions in feature.php

    that i need the caption of images in feature gallery slider , how i can do it in below code, please i really need help on this ๐Ÿ™

    // Featured Gallery
    // =============================================================================

    if ( ! function_exists( ‘x_featured_gallery’ ) ) :
    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 ‘<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 ‘‘;
    }
    echo ‘</div>’;

    }

    }
    endif;

    #1116397
    Rue Nel
    Moderator

    Hello There,

    Thanks for the updates! To display the image captions in the featured gallery slider, please add the following code in your child themeโ€™s functions.php file

    // Custom Featured Gallery displaying the image captions
    // =============================================================================
    if ( ! function_exists( 'x_featured_gallery' ) ) :
      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 '<div class="x-flexslider x-flexslider-featured-gallery man"><ul class="x-slides">';
            foreach ( $attachments as $attachment ) {
              $get_description = get_post($attachment->ID)->post_excerpt; 
    
              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 );
                }
    
              if(!empty($get_description)){
                //If description is not empty show the div 
                echo '<div class="img-caption">' . $get_description . '</div>'; 
              }
    
              echo '</li>';
            }
          echo '</ul></div>';
        }
    
      }
    endif;
    // =============================================================================

    And after that you also need to add the following css code in the customizer, Appearance > Customize > Custom > CSS

    .x-flexslider .x-slides .x-slide {
        position: relative;
    }
    
    .x-flexslider .x-slides .x-slide .img-caption {
        position: absolute;
        top: auto;
        bottom: 0;
        width: 100%;    
        background-color: rgba(0,0,0,0.5);
        color: #fff;
        padding: 10px;
    }

    You should be expecting something like this: http://prnt.sc/c1cff2

    We would loved to know if this has work for you. Thank you.

    #1116850
    Rish
    Participant
    This reply has been marked as private.
    #1116899
    Rupok
    Member

    Hi there,

    That could be possible with some custom CSS. Would you provide exact URL of your site where you are using this?

    Cheers!

    #1116973
    Rish
    Participant
    This reply has been marked as private.
    #1117131
    Christian
    Moderator

    Please add the code below in your Appearance > Customize > Custom > CSS

    .x-flexslider .x-slides .x-slide .img-caption {
        position: static !important;
    }

    Further customizations from here would be getting into custom development, which is outside the scope of support we can offer. If you need more in depth changes, you may wish to consult with a developer. X is quite extensible with child themes, so there are plenty of possibilities. Thanks for understanding.

    #1117219
    Rish
    Participant

    Awesome , You guys are best ๐Ÿ™‚

    #1117422
    Rahul
    Moderator

    You’re welcome!

    If you still have any further issues, do let us know. We’d be happy to assist you with everything.

    Thanks for using the X-Theme.

    #1118688
    Rish
    Participant

    Last thing i need to ask .. can we make it auto slide , as currently we have to, slide next manually.

    #1119254
    Jade
    Moderator

    Hi there,

    Please try adding following under Custom > JavaScript in the Customizer:

    jQuery(window).load(function() {
      jQuery('.x-flexslider-featured-gallery').flexslider({
        controlNav: false,
        animation: "fade",
        easing: "easeInOutExpo",
        slideshow: true
      });
    });

    Hope this helps.

    #1123243
    Rish
    Participant
    This reply has been marked as private.
  • <script> jQuery(function($){ $("#no-reply-1115114 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>