Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1170541

    Hi there,

    Loving the flexibility of your theme and the fantastic support you offer.

    I’m trying to “trick out” the Post Slider on my website and am hitting some obstacles. Please see below and let me know what is possible.

    Notes
    I am currently using the following function to randomize the post order. This code is working great. I wanted to let you know, in case this code interferes with anything else.

    add_filter('avia_post_slide_query', 'enfold_customization_query_custom');
    function enfold_customization_query_custom( $query ) {
    	$query['orderby'] = 'rand';
    	return $query;
    }

    Customization 1: Fixing excerpt length

    Fixing the excerpt length will allow the blog posts to display uniformly. The code below was on a previous support topic. I’ve attempted modifying the “return value” to no effect. Can you assist in me making the excerpt length a certain amount?

    // POST SLIDER EXCERPT LENGTH
    add_filter('avf_postgrid_excerpt_length','avia_change_excerpt_length',10,1);
    function avia_change_excerpt_length()
    {
    return 30;

    }

    Customization 2: Changing “Read More” text

    I’ve modified the Read More link in includes/loop-index.php, but the text on the “Read More” link remains the same. Here’s the code I’ve modified in loop-index.php:

    	$current_post['content'] = apply_filters( 'avf_the_content', '', 'loop_index' );
    	if( '' == $current_post['content'] )
    	{
    		$current_post['content'] 	= $blog_content == "content" ? get_the_content(__('Read »','avia_framework').'<span class="more-link-arrow"></span>') : get_the_excerpt();

    Please advise on how to modify the “Read More” text correctly.

    Customization 3: Change symbol on slider controls

    How would I replace the symbol on the slider controls from the simple “>” or “<” to a character or image of my choosing?

    You guys rock! Thanks in advance for all of your help.

    #1170618

    Hey Joe,

    Thank you for the inquiry.

    1.) Did you define the excerpt manually? You won’t be able to control the excerpt length if the summary was added manually.

    2.) You have to modify the wp-content\themes\enfold\config-templatebuilder\avia-shortcodes\postslider\postslider.php file directly in order to change the read more text. Look for this code around line 639:

    $permalink = '
    <div class="read-more-link"><a href="' . get_permalink( $the_id ) . '" class="more-link">' . __( 'Read more', 'avia_framework' ) . '<span class="more-link-arrow"></span></a></div>
    ';
    

    3.) Use the avf_default_icons filter to change the default icon of next and previous navigation. Usage example can be found in the following documentation.

    // https://kriesi.at/documentation/enfold/icon/#change-icon-used-for-standard-theme-elements-

    Best regards,
    Ismael

    #1171188

    Hi Ismael,

    Thank you! Please see below:

    1). Yes, I was defining the excerpt manually. I deleted the manual excerpt and there is no output on the Post Slider now. The Post Slider is set to display Title and Excerpt + Read More Link. I fear I’m missing something simple. How do I get the excerpt to display?

    2) This worked great. Thank you!

    3) I will take a look at this. Much appreciated!

    #1171686

    Hi,

    Thank you for the update.

    1.) Are you using the advance layout builder for your posts? No excerpt will be generated automatically if that’s the case, so you may still have to define the excerpts of the posts manually and adjust the length prior.

    Best regards,
    Ismael

    #1172446

    Hi Ismael,

    I switched back to the Default Editor for the blog posts and the excerpt is outputting as defined. Perfect!

    Thank you so much for your help.

    • This reply was modified 4 years, 10 months ago by daniejm. Reason: Corrected spelling
    #1172470

    Hi,

    Did you need further help on this topic or shall we close?

    Best regards,
    Jordan Shannon

    #1172552

    Hi Jordan,

    This topic is ready to be closed. Much appreciated!

    #1172643

    Hi daniejm,

    We’re glad to hear that :)
    Thanks for using Enfold and have a great day!

    Best regards,
    Nikko

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Modifications to Post Slider’ is closed to new replies.