Viewing 18 posts - 1 through 18 (of 18 total)
  • Author
    Posts
  • #987134

    Hi, i use the enfold entry slider with the categorie from the event calender plugins.
    It works fine.

    The problem:
    its sorted by the latest entry. ex: December, november, september, august, juli, juni etc
    It would be cool if sorted by: juni, juli, august, september etc..

    It is possible to change?

    Best
    Chris

    #987425

    Hey Kingsfield,

    Thank you for using Enfold.

    Where can we see the categories? Please provide a link to the actual page so that we could inspect it.

    Best regards,
    Ismael

    #987450

    Hi Ismael, thanks for your quick reply.
    Actually the website is in maintenance mode so I can´t show. But its okay.
    Come back if I have finish the website and react this thread.

    Best regards

    #987835

    Hi,

    Alright. We’ll keep the thread open. Let us know once the site is ready. :)

    Best regards,
    Ismael

    #992128

    Hi Ismael.
    Sorry for delay. Litte vacation :)

    First of all the website is not ready yet.
    What i did:
    I copy this code:

    add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1);
    function avia_include_shortcode_template($paths)
    {
      $template_url = get_stylesheet_directory();
          array_unshift($paths, $template_url.'/shortcodes/');
    
      return $paths;
    }

    to my function.php and i have created a folder called /shortcodes. After that i copy all files from the original theme /enfold/config-templatebuilder/avia-shortcodes/postslider to my new folder.

    Than I changed this: $order = ‘DESC’; to $order = ‘ASC’; in /postslider.php | row 761 (DESC = Descending / ASC = Ascending)
    Works fantastic.
    Currently I have the problem that all events are displayed. The past, too. (Dates are correct) Only the upcoming events should be displayed

    An the second:
    I would like to have the date above the slide-image.
    I found this in /postslider.php:

    $output .= '<footer class="entry-footer">';
                        if( !empty($meta) ) $output .= $meta;
                        $output .= '</footer>';

    But where i have to copy it above the silde-image?

    best regards
    Chris

    • This reply was modified 6 years, 3 months ago by Kingsfield.
    #992681

    Hi,

    Thanks for the update.

    You can try this filter to fetch and only display the upcoming events.

    add_filter('avia_post_slide_query', 'avia_post_slide_query_mod', 10, 2);
    function avia_post_slide_query_mod( $query, $params ) {
    	$eventquery = array('paged'=> false, 'eventDisplay' => 'list');
    	$upcoming = Tribe__Events__Query::getEvents( $eventquery, true);
    
    	$include = array();
    
    	foreach($upcoming->posts as $key => $event) {
    		$include[] = $event->ID;
    	}
    
    	$query['tax_query'] = array();
    
    	$query['post__in'] = $include;
    	return $query;
    }

    You may need to add a conditional function to exclude other posts sliders.

    Best regards,
    Ismael

    #992946

    Hi Ismael, thanks for your quick reply.
    I enter the code above in my functions.php. It works partly.
    Now I have the upcoming events, but the created date is displayed. Not the date of the event.
    And secondly all categories are displayed, although I eg. choose only one category.

    Strange! :)

    best regards
    Chris

    #993223

    Hi,

    Thanks for the update.

    That was actually intended. The filter will just query every upcoming events regardless of the category. Please post the login details in the private field so that we can test the filter.

    Best regards,
    Ismael

    #993358

    Hi Ismael,
    in the private section you will find the login details
    Best regards
    Chris

    #993808

    Hi,

    Thanks for the update.

    I adjusted the filter query a bit and it’s now displaying events from the specified categories.

    You need to edit the config-templatebuilder > avia-shortcodes > postslider > postslider.php file around line 629 to display the start date. It is currently displaying the published date, which is how it’s supposed to work by default.

    $meta .= "<time class='slide-meta-time updated' $markup>" .get_the_time(get_option('date_format'), $the_id)."</time>";
    

    Replace the default date function with “tribe_get_start_date”.

    Best regards,
    Ismael

    #994259

    Hi Ismael, thanks.
    I´ll check today and let you know.
    Best regards
    Chris

    #994647

    Hi,

    Alright. Let us know when you’ve checked it. :)

    Best regards,
    Ismael

    #994742

    Hi Ismael,
    sorry for delay.

    Hi add this to postslider.php: .tribe_get_start_date( $entry->ID, false, 'F j, Y' )
    Works fine. The event start dates are displayed

    Currently, the problem is that only display one categorie if i choose more than one on the startpage. Strange ! :)

    best regards
    Chris

    #995288

    Hi,

    Thanks for the update.

    I adjusted the filter a bit — it should work as expected now. I had to convert the category strings to an array.

    Best regards,
    Ismael

    #995369

    Hi Ismael, thanks. Works perfectly. :)
    If it´s okay I would like to post the result for other creatives down below

    best regards
    Chris

    #995502

    Hi Kingsfield,

    Glad Ismael could help :)

    Here is the function for other creatives :

    
    /*
    * add a upcoming event filte to postslider
    */
    add_filter('avia_post_slide_query', 'avia_post_slide_query_mod', 10, 2);
    function avia_post_slide_query_mod( $query, $params ) {
    	$eventquery = array('paged'=> false, 'eventDisplay' => 'list', 'tax_query'=> array(
            array(
                'taxonomy' => 'tribe_events_cat',
                'field' => 'term_id',
                'terms' => explode(',', $params['categories'])
            )
        ));
    	
        $upcoming = Tribe__Events__Query::getEvents( $eventquery, true);
    	
    	$include = array();
    
    	foreach($upcoming->posts as $key => $event) {
    		$include[] = $event->ID;
    	}
    
    	$query['tax_query'] = array();
    
    	$query['post__in'] = $include;
    	return $query;
    }
    

    Best regards,
    Victoria

    #995764

    Thanks Ismael & Victoria.

    Here my tutorial to use the enfold postslider with the plugin “Event Calender”

    1. Copy this code to your function.php in your child theme (important)

    add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1);
    function avia_include_shortcode_template($paths)
    {
      $template_url = get_stylesheet_directory();
          array_unshift($paths, $template_url.'/shortcodes/');
    
      return $paths;
    }

    2. Copy this code to your function in your child theme

     <?php
    
    /*
    * Add your own functions here. You can also copy some of the theme functions into this file. 
    * WordPress will use those functions instead of the original functions then.
    */
    
    /*
     * Enfold Avia Shortcode changes for child theme
     */
    
    add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1);
    function avia_include_shortcode_template($paths)
    {
      $template_url = get_stylesheet_directory();
          array_unshift($paths, $template_url.'/shortcodes/');
    
      return $paths;
    }
    
    /*
    * add a upcoming event filte to postslider
    */
    add_filter('avia_post_slide_query', 'avia_post_slide_query_mod', 10, 2);
    function avia_post_slide_query_mod( $query, $params ) {
    	$eventquery = array('paged'=> false, 'eventDisplay' => 'list', 'tax_query'=> array(
            array(
                'taxonomy' => 'tribe_events_cat',
                'field' => 'term_id',
                'terms' => explode(',', $params['categories'])
            )
        ));
    	
        $upcoming = Tribe__Events__Query::getEvents( $eventquery, true);
    	
    	$include = array();
    
    	foreach($upcoming->posts as $key => $event) {
    		$include[] = $event->ID;
    	}
    
    	$query['tax_query'] = array();
    
    	$query['post__in'] = $include;
    	return $query;
    }

    3. Create a folder called /shortcodes (important) in your child theme. After that copy all files from the original theme /enfold/config-templatebuilder/avia-shortcodes/postslider to the folder /shortcodes

    4. Than change this in file: postslider.php | row 761:
    $order = ‘DESC’; to $order = ‘ASC’; (DESC = Descending / ASC = Ascending)

    5. In your postslider.php change this code | row 629 (This entry is to display the startdate from the event.)
    $meta .= "<time class='slide-meta-time updated' $markup>" .get_the_time(get_option('date_format'), $the_id)."</time>";
    in
    $meta .= "<time class='slide-meta-time updated' $markup>" .tribe_get_start_date( $entry->ID, false, 'F j, Y' )."</time>";
    This entry is to display the startdate from the event.

    Different display:
    a .tribe_get_start_date( $entry->ID, false, ‘F j, Y’ ). Looks like this: November 11, 2018
    b .tribe_get_start_date( $entry->ID, false, ‘F j, Y – g:i a’ ). Looks like this: November 11, 2018 – 9:00 am
    c .tribe_get_start_date( $entry->ID ). Looks like this: .November 11 @ 9:00
    Change the @ sign in the plugin options from event calender in what you like.

    Addional.
    Limiting excerpt (if you want to limit the excerpt in postslider)
    Add this code to your functions.php

    add_filter('avf_postgrid_excerpt_length','avia_change_excerpt_length',10,1);
    function avia_change_excerpt_length()
    {
    return 65;
    }

    Change “return 65” to increase or reduce the excerpt. Example return 100;

    Have fun.

    Thanks Enfold team for helping me.
    Best regards
    Chris

    • This reply was modified 6 years, 3 months ago by Kingsfield.
    #995866

    Hi,

    Awesome! Thanks for the tutorial! Looks good. :)

    Please take a moment to review our theme and show your support https://themeforest.net/downloads
    Don’t forget to bookmark Enfold Documentation for future reference.

    Thank you for using Enfold :)

    Best regards,
    Ismael

Viewing 18 posts - 1 through 18 (of 18 total)
  • You must be logged in to reply to this topic.