Tagged: 

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #427519

    Hello, I’d like to replicate pagination at the top of the blog loop (using avia builder “Blog Posts”) so that it appears both top and bottom, is there a way to do this?

    Thanks!

    #427807

    Hey jimbatchelder!

    Open up /enfold/includes/loop-index.php and around line 12 you should see this.

    if (have_posts()) :
    

    Add this beneath it.

    if(empty($avia_config['remove_pagination'] ))
    {
    	echo "<div class='{$blog_style}'>".avia_pagination('', 'nav')."</div>";
    }

    Regards,
    Elliott

    • This reply was modified 9 years, 8 months ago by Elliott.
    #427814

    I added the code but something isn’t quite right, no change on the page. The page I’m working on is at http://resteasyhosting.com/col2015/education/ . Here is the code after I added your suggestion:
    <?php
    global $avia_config, $post_loop_count;
    if(empty($post_loop_count)) $post_loop_count = 1;
    $blog_style = !empty($avia_config[‘blog_style’]) ? $avia_config[‘blog_style’] : avia_get_option(‘blog_style’,’multi-big’);
    if(is_single()) $blog_style = avia_get_option(‘single_post_style’,’single-big’);
    $initial_id = avia_get_the_ID();
    // check if we got posts to display:
    if (have_posts()) :
    `if(empty($avia_config[‘remove_pagination’] ))
    {
    echo “<div class='{$blog_style}’>”.avia_pagination(”, ‘nav’).”</div>”;
    }`
    while (have_posts()) : the_post();
    /*

    #428361

    Hey!

    I don’t see it. Did you remove it?

    Best regards,
    Elliott

    #428395

    no, the page is still there and the code you sent is still in loop-index.php.

    #429086

    Hi!

    Send us a WordPress login.

    Regards,
    Elliott

    #429093
    This reply has been marked as private.
    #429586

    Hi!

    Thank you for your feedback.

    I cannot access http://www.resteasyhosting.com/wp-admin
    Can you give us the link to your login page, pls.

    Just for a try – replace the code above with:

    
    echo '<p>  -----------------  </p>';
    echo "<div class='{$blog_style}'>".avia_pagination('', 'nav')."</div>";
    

    This should produce an output in any case.

    Best regards,
    Günter

    #429729
    This reply has been marked as private.
    #430373

    Hi!

    Thanks for the feedback.

    The code above does not work, because you use a grid layout. I removed the code already.

    You have to modify an ALB element.

    In functions.php of the child theme put the following:

    
    /**
     *	Add filter to add or replace Enfold ALB shortcodes with new folder contents
     *	
     *	Note that the shortcodes must be in the same format as those in 
     *	enfold/config-templatebuilder/avia-shortcodes
     *
     *	@link http://kriesi.at/documentation/enfold/add-new-or-replace-advanced-layout-builder-elements-from-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;
    }
    
    

    Create a subfolder shortcodes in the child theme directory and copy

    enfold\config-templatebuilder\avia-shortcodes\postslider.php

    Open the copied file, goto line 282 and locate:

    
    			$output .= 		"<div class='avia-content-slider-inner'>";
    

    Before this line insert:

    
              if($use_main_query_pagination == 'yes' && $paginate == "yes")
                {
                    global $wp_query;
                    $avia_pagination = avia_pagination($wp_query->max_num_pages, 'nav');
                }
                else if($paginate == "yes")
                {
                    $avia_pagination = avia_pagination($this->entries->max_num_pages, 'nav');
                }
    
                if(!empty($avia_pagination)) $output .= "<div class='pagination-wrap pagination-slider'>{$avia_pagination}</div>";
    

    Be aware that < or > are not changed !!!

    If you have troubles, create the directory, copy the file and we will insert the code for you.

    Regards,
    Günter

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