Plugin Directory

Changeset 2553994


Ignore:
Timestamp:
06/25/2021 01:55:43 PM (5 years ago)
Author:
marcopappalardo
Message:

added hooks in postcard elements

Location:
all-in-one-avada-addons
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • all-in-one-avada-addons/tags/1.2.0/all-in-one-avada-addons.php

    r2553478 r2553994  
    44 * Plugin URI: http://www.advisionplus.com
    55 * Description: This is an addons collection for Avada Theme.
    6  * Version: 1.1.7
     6 * Version: 1.2.0
    77 * Author: Marco Pappalardo
    88 * Author URI: http://www.marcopappalardo.it
  • all-in-one-avada-addons/tags/1.2.0/assets/css/public/aio-post-card.css

    r2553475 r2553994  
    11/* Aio Post Card Css generated from aio_css_generator method in aio_credit_class */
    2 .aio-post-card {display: flex; flex-wrap: wrap; flex-direction: row;}#aio-post-card-1 .aio-post-card-image-link, #aio-post-card-1 .aio-post-card-image-link img {display: grid; width: ;}#aio-post-card-1 .item .aio-single-post-card-content{margin-top: 10px; margin-right: 10px; margin-bottom: 10px; margin-left: 10px;text-align: left;}#aio-post-card-1 .aio-post-card-title h3{text-transform:none;}#aio-post-card-1 .aio-post-card-excerpt{text-transform:none;}#aio-post-card-1 .aio-post-card-main-button a{text-transform:none;}@media (min-width: 1200px) {.aio-col-lg-4 .aio-single-post-card-content {display: grid;}#aio-post-card-1 .aio-col-lg-1 {max-width: 25%; flex: 25%;}}@media (min-width: 640px) and (max-width: 1200px) {.item.aio-col-md-4 .aio-single-post-card-content {max-width: 25%; display: grid; flex: 25%;}}@media (max-width: 640px) {.item.aio-col-sm-4 .aio-single-post-card-content {max-width: 25%; display: grid; flex: 25%;}}
     2.aio-post-card {display: flex; flex-wrap: wrap; flex-direction: row;}#aio-post-card-1 .aio-post-card-image-link {display: grid; max-width: 45%;}#aio-post-card-1 .aio-post-card-content {display: flex; flex-direction: column; margin: auto; max-width: 55%;}#aio-post-card-1 .item .aio-single-post-card-content{margin-top: 10px; margin-right: 10px; margin-bottom: 10px; margin-left: 10px;text-align: left;}#aio-post-card-1 .aio-post-card-title h3{text-transform:none;margin-left: 50px;}#aio-post-card-1 .aio-post-card-excerpt{text-transform:none;margin-right: 50px; margin-left: 50px;}#aio-post-card-1 .aio-post-card-main-button a{text-transform:none;margin-left: 50px;}#aio-post-card-1 .item:nth-child(even) .aio-single-post-card-content .aio-post-card-image-link{order: 2;} .aio-post-card-pagination {width: 100%;} .page-numbers {display: flex; flex-direction: row; padding-left: 0; } .page-numbers li {list-style: none; width: max-content;} .page-numbers li .prev,  .page-numbers li .next {display: table; padding: 0 15px;} a.page-numbers:not(.current, .prev, .next) {display: none;}@media (min-width: 1200px) {.aio-post-card-large .aio-col-lg-1 {max-width: 100%; display: flex; flex: 100%;}.aio-post-card-large .aio-col-lg-1 .aio-single-post-card-content {display: flex;}}@media (min-width: 640px) and (max-width: 1200px) {.aio-post-card-large .aio-col-md-1 {max-width: 100%; display: flex; flex: 100%;}.aio-post-card-large .aio-col-md-1 .aio-single-post-card-content {display: flex;}}@media (max-width: 640px) {.aio-post-card-large .aio-col-sm-1 {max-width: 100%; display: flex; flex: 100%;}.aio-post-card-large .aio-col-sm-1 .aio-single-post-card-content {display: flex;}}
     3.aio-post-card {display: flex; flex-wrap: wrap; flex-direction: row;}#aio-post-card-2 .aio-post-card-image-preview, #aio-post-card-2 .aio-post-card-image-preview img {display: grid; width: %;}#aio-post-card-2 .item .aio-single-post-card-content{margin-top: 10px; margin-right: 10px; margin-bottom: 10px; margin-left: 10px;text-align: left;}#aio-post-card-2 .aio-post-card-title h3{text-transform:none;}#aio-post-card-2 .aio-post-card-excerpt{text-transform:none;}#aio-post-card-2 .aio-post-card-main-button a{text-transform:none;}@media (min-width: 1200px) {.aio-post-card-grid .aio-col-lg-1 .aio-single-post-card-content {display: flex; flex-direction: column;}.aio-post-card-grid .aio-post-card-content {display:grid; height:100%;}.aio-post-card-grid .aio-post-card-main-button {align-items: flex-end; display: grid; align-content: end;}.aio-post-card-grid .aio-col-lg-1 {max-width: 100%; flex: 100%; display: flex;}}@media (min-width: 640px) and (max-width: 1200px) {.aio-post-card-grid .aio-col-md-1 .aio-single-post-card-content {display: flex; flex-direction: column;}.aio-post-card-grid .aio-post-card-content {display:grid; height:100%;}.aio-post-card-grid .aio-post-card-main-button {align-items: flex-end; display: grid; align-content: end;}.aio-post-card-grid .aio-col-md-1 {max-width: 100%; flex: 100%; display: flex;}}@media (max-width: 640px) {.aio-post-card-grid .aio-col-sm-1 .aio-single-post-card-content {display: flex; flex-direction: column;}.aio-post-card-grid .aio-post-card-content {display:grid; height:100%;}.aio-post-card-grid .aio-post-card-main-button {align-items: flex-end; display: grid; align-content: end;}.aio-post-card-grid .aio-col-sm-1 {max-width: 100%; flex: 100%; display: flex;}}
     4.aio-post-card {display: flex; flex-wrap: wrap; flex-direction: row;}#aio-post-card-3 .aio-post-card-image-preview, #aio-post-card-3 .aio-post-card-image-preview img {display: grid; width: %;}#aio-post-card-3 .item .aio-single-post-card-content{margin-top: 10px; margin-right: 10px; margin-bottom: 10px; margin-left: 10px;text-align: left;}#aio-post-card-3 .aio-post-card-title h3{text-transform:none;}#aio-post-card-3 .aio-post-card-excerpt{text-transform:none;}#aio-post-card-3 .aio-post-card-main-button a{text-transform:none;}@media (min-width: 1200px) {.aio-post-card-grid .aio-col-lg-4 .aio-single-post-card-content {display: flex; flex-direction: column;}.aio-post-card-grid .aio-post-card-content {display:grid; height:100%;}.aio-post-card-grid .aio-post-card-main-button {align-items: flex-end; display: grid; align-content: end;}.aio-post-card-grid .aio-col-lg-4 {max-width: 25%; flex: 25%; display: flex;}}@media (min-width: 640px) and (max-width: 1200px) {.aio-post-card-grid .aio-col-md-3 .aio-single-post-card-content {display: flex; flex-direction: column;}.aio-post-card-grid .aio-post-card-content {display:grid; height:100%;}.aio-post-card-grid .aio-post-card-main-button {align-items: flex-end; display: grid; align-content: end;}.aio-post-card-grid .aio-col-md-3 {max-width: 33.33%; flex: 33.33%; display: flex;}}@media (max-width: 640px) {.aio-post-card-grid .aio-col-sm-3 .aio-single-post-card-content {display: flex; flex-direction: column;}.aio-post-card-grid .aio-post-card-content {display:grid; height:100%;}.aio-post-card-grid .aio-post-card-main-button {align-items: flex-end; display: grid; align-content: end;}.aio-post-card-grid .aio-col-sm-3 {max-width: 33.33%; flex: 33.33%; display: flex;}}
  • all-in-one-avada-addons/tags/1.2.0/builder-elements/post-card.php

    r2553475 r2553994  
    5050                        [
    5151                            'type'        => 'textfield',
    52                             'heading'     => esc_attr__( 'Terms', 'avada_addons' ),
     52                            'heading'     => esc_attr__( 'Terms ID', 'avada_addons' ),
    5353                            'description' => esc_attr__( 'Filter list of terms to show.', 'avada_addons' ),
    5454                            'param_name'  => 'terms',
     
    161161                            'value'       => [
    162162                                'grid'              => esc_attr__( 'Grid', 'avada_addons' ),
    163                                 'large'  => esc_attr__( 'Large', 'avada_addons' ),
     163                                'large'             => esc_attr__( 'Large', 'avada_addons' ),
    164164                            ],
    165165                            'group'       => esc_attr__( 'Design', 'avada_addons' ),
  • all-in-one-avada-addons/tags/1.2.0/readme.txt

    r2553475 r2553994  
    33Donate link: marcopappalardo.it
    44Requires at least: 3.0
    5 Tested up to: 5.6
     5Tested up to: 5.7.2
    66Requires PHP: 5.6
    77License: GPLv3
     
    1414
    1515= Features List =
    16 - Woocommece Carousel for Discounted Products
    17 - Woocommece Carousel for Sest-Selling Product
    18 - Woocommerce List of products
    19 - Carousel for Custom Post Type
    20 - Post and Custom Post Type Archive
     16- Credits Area
     17- Post Card with default layouts
     18- Post carousel
     19- WooCommerce Product layouts
    2120
    2221= Add Elements by Fusion Builder =
    2322You can add individual components directly from the fusion builder. To do this you will need to search for the following elements in the builder elements:
    2423
    25 - Post Carousel by tax and term AIO
    26 - Post Archive AIO
    27 - Woocommerce Best Sellers Carousel AIO
    28 - Woocommerce On Sales Carousel AIO
     24- Credit AIO
     25- Post card AIO
     26- Post Carousel AIO
    2927- WooCommerce Product AIO
    3028
  • all-in-one-avada-addons/tags/1.2.0/template/shortcode-post-card.php

    r2553478 r2553994  
    88
    99        public $aio_avada, $atts, $css, $output_css, $counter, $posts;
    10         private $display_col_type, $title_font, $pagination_visibility;
     10        private $display_col_type, $title_font, $pagination_visibility, $image_visibility, $title_visibility, $content_visibility, $button_visibility, $number_of_columns;
    1111        public $i = 0;
    1212
     
    177177                    'paged'             => get_query_var('paged'),
    178178                );
    179                 $this->posts = new WP_Query($this->args) /* get_posts($this->args) */;
     179                $this->posts = new WP_Query($args);
    180180            }
    181181   
     
    190190                    'paged'             => get_query_var('paged'),
    191191                );
    192                 $this->posts = new WP_Query($args_no_cat) /* get_posts($args_no_cat) */;
     192                $this->posts = new WP_Query($args_no_cat);
    193193            }
    194194           
     
    216216            //IMAGE VISIBILITY
    217217            if($this->atts['show_image']=='no'){
    218                 $image_visibility[] = 'aio-large-hidden';
    219             }else{
    220                 $image_visibility[] = '';
     218                $this->image_visibility[] = 'aio-large-hidden';
     219            }else{
     220                $this->image_visibility[] = '';
    221221            }
    222222            if($this->atts['show_image_medium']=='no'){
    223                 $image_visibility[] = 'aio-medium-hidden';
    224             }else{
    225                 $image_visibility[] = '';
     223                $this->image_visibility[] = 'aio-medium-hidden';
     224            }else{
     225                $this->image_visibility[] = '';
    226226            }
    227227            if($this->atts['show_image_small']=='no'){
    228                 $image_visibility[] = 'aio-small-hidden';
    229             }else{
    230                 $image_visibility[] = '';
     228                $this->image_visibility[] = 'aio-small-hidden';
     229            }else{
     230                $this->image_visibility[] = '';
    231231            }
    232232            //TITLE VISIBILITY
    233233            if($this->atts['show_title']=='no'){
    234                 $title_visibility[] = 'aio-large-hidden';
    235             }else{
    236                 $title_visibility[] = '';
     234                $this->title_visibility[] = 'aio-large-hidden';
     235            }else{
     236                $this->title_visibility[] = '';
    237237            }
    238238            if($this->atts['show_title_medium']=='no'){
    239                 $title_visibility[] = 'aio-medium-hidden';
    240             }else{
    241                 $title_visibility[] = '';
     239                $this->title_visibility[] = 'aio-medium-hidden';
     240            }else{
     241                $this->title_visibility[] = '';
    242242            }
    243243            if($this->atts['show_title_small']=='no'){
    244                 $title_visibility[] = 'aio-small-hidden';
    245             }else{
    246                 $title_visibility[] = '';
     244                $this->title_visibility[] = 'aio-small-hidden';
     245            }else{
     246                $this->title_visibility[] = '';
    247247            }
    248248            //CONTENT VISIBILITY
    249249            if($this->atts['show_content']=='no'){
    250                 $content_visibility[] = 'aio-large-hidden';
    251             }else{
    252                 $content_visibility[] = '';
     250                $this->content_visibility[] = 'aio-large-hidden';
     251            }else{
     252                $this->content_visibility[] = '';
    253253            }
    254254            if($this->atts['show_content_medium']=='no'){
    255                 $content_visibility[] = 'aio-medium-hidden';
    256             }else{
    257                 $content_visibility[] = '';
     255                $this->content_visibility[] = 'aio-medium-hidden';
     256            }else{
     257                $this->content_visibility[] = '';
    258258            }
    259259            if($this->atts['show_content_small']=='no'){
    260                 $content_visibility[] = 'aio-small-hidden';
    261             }else{
    262                 $content_visibility[] = '';
     260                $this->content_visibility[] = 'aio-small-hidden';
     261            }else{
     262                $this->content_visibility[] = '';
    263263            }
    264264            //BUTTON VISIBILITY
    265265            if($this->atts['show_button']=='no'){
    266                 $button_visibility[] = 'aio-large-hidden';
    267             }else{
    268                 $button_visibility[] = '';
     266                $this->button_visibility[] = 'aio-large-hidden';
     267            }else{
     268                $this->button_visibility[] = '';
    269269            }
    270270            if($this->atts['show_button_medium']=='no'){
    271                 $button_visibility[] = 'aio-medium-hidden';
    272             }else{
    273                 $button_visibility[] = '';
     271                $this->button_visibility[] = 'aio-medium-hidden';
     272            }else{
     273                $this->button_visibility[] = '';
    274274            }
    275275            if($this->atts['show_button_small']=='no'){
    276                 $button_visibility[] = 'aio-small-hidden';
    277             }else{
    278                 $button_visibility[] = '';
     276                $this->button_visibility[] = 'aio-small-hidden';
     277            }else{
     278                $this->button_visibility[] = '';
    279279            }
    280280            //PAGINATION VISIBILITY
    281281            if($this->atts['pagination']=='no'){
    282                 $pagination_visibility[] = 'aio-large-hidden';
    283             }else{
    284                 $pagination_visibility[] = '';
     282                $this->pagination_visibility[] = 'aio-large-hidden';
     283            }else{
     284                $this->pagination_visibility[] = '';
    285285            }
    286286            if($this->atts['pagination_medium']=='no'){
    287                 $pagination_visibility[] = 'aio-medium-hidden';
    288             }else{
    289                 $pagination_visibility[] = '';
     287                $this->pagination_visibility[] = 'aio-medium-hidden';
     288            }else{
     289                $this->pagination_visibility[] = '';
    290290            }
    291291            if($this->atts['pagination_small']=='no'){
    292                 $pagination_visibility[] = 'aio-small-hidden';
    293             }else{
    294                 $pagination_visibility[] = '';
    295             }
    296 
    297             //NUMBER OF COLUMN ON LARGE SCREEN
    298             switch($this->atts['columns']){
    299                 case 1:
    300                     $number_of_columns[] = 'aio-col-lg-1';
    301                     break;
    302                 case 2:
    303                     $number_of_columns[] = 'aio-col-lg-2';
    304                     break;
    305                 case 3:
    306                     $number_of_columns[] = 'aio-col-lg-3';
    307                     break;
    308                 case 4:
    309                     $number_of_columns[] = 'aio-col-lg-4';
    310                     break;
    311                 case 5:
    312                     $number_of_columns[] = 'aio-col-lg-5';
    313                     break;
    314                 case 6:
    315                     $number_of_columns[] = 'aio-col-lg-6';
    316                     break;
    317             }
    318             //NUMBER OF COLUMN ON MEDIUM SCREEN
    319             switch($this->atts['columns_medium']){
    320                 case 1:
    321                     $number_of_columns[] = 'aio-col-md-1';
    322                     break;
    323                 case 2:
    324                     $number_of_columns[] = 'aio-col-md-2';
    325                     break;
    326                 case 3:
    327                     $number_of_columns[] = 'aio-col-md-3';
    328                     break;
    329                 case 4:
    330                     $number_of_columns[] = 'aio-col-md-4';
    331                     break;
    332                 case 5:
    333                     $number_of_columns[] = 'aio-col-md-5';
    334                     break;
    335                 case 6:
    336                     $number_of_columns[] = 'aio-col-md-6';
    337                     break;
    338             }
    339             //NUMBER OF COLUMN ON SMALL SCREEN
    340             switch($this->atts['columns_small']){
    341                 case 1:
    342                     $number_of_columns[] = 'aio-col-sm-1';
    343                     break;
    344                 case 2:
    345                     $number_of_columns[] = 'aio-col-sm-2';
    346                     break;
    347                 case 3:
    348                     $number_of_columns[] = 'aio-col-sm-3';
    349                     break;
    350                 case 4:
    351                     $number_of_columns[] = 'aio-col-sm-4';
    352                     break;
    353                 case 5:
    354                     $number_of_columns[] = 'aio-col-sm-5';
    355                     break;
    356                 case 6:
    357                     $number_of_columns[] = 'aio-col-sm-6';
    358                     break;
    359             }
     292                $this->pagination_visibility[] = 'aio-small-hidden';
     293            }else{
     294                $this->pagination_visibility[] = '';
     295            }
     296
    360297            //COLUMNS DISPLAY TYPE
    361298            switch($this->atts['template']){
     
    369306           
    370307
    371 
    372             /**
     308            ob_start();
     309            /**
     310             * GRID TEMPLATE
    373311             * Html to renderize in frontend
    374312             * This is a custom condition and change for each of element builder type
    375313             */
    376 
    377             //--------------------------------------------------------->GRID TEMPLATE
    378314            if($this->atts['template'] == 'grid'){
    379                 $html .= '<div id="aio-post-card-'.$this->i.'" class="aio-post-card aio-post-card-grid">';
     315                $this->template_grid();
     316            }
     317
     318            /**
     319            * LARGE TEMPLATE
     320            * Html to renderize in frontend
     321            * This is a custom condition and change for each of element builder type
     322            */
     323            if($this->atts['template'] == 'large'){
     324                $this->template_large();
     325            }
     326           
     327
     328            /**
     329             * Call a function for css generation
     330             */
     331            $this->aio_css_generator($this->atts, $this->i);
     332
     333            return ob_get_clean();
     334        }
     335
     336        function template_large(){
     337            $this->number_of_columns();
     338
     339            do_action('before_aio_large_postcard');
     340            echo '<div id="aio-post-card-'.$this->i.'" class="aio-post-card aio-post-card-large">';
     341            do_action('before_aio_large_postcard_inside');
     342
     343            if ( $this->posts->have_posts() ) {
     344                while ( $this->posts->have_posts() ) {
     345                $this->posts->the_post();
     346
     347                    echo '<div id="'.$this->atts['id'].'" class="item '.$this->atts['class'].' '.implode(" ", $this->number_of_columns).'">';
     348                   
     349                    do_action('before_aio_large_postcard_content');
     350                    echo '<div class="aio-single-post-card-content">';
     351                       
     352                        do_action('before_aio_large_postcard_image');
     353                        echo '<div class="aio-post-card-image-link">';
     354                            if($this->atts['linkable']=='yes'){
     355                        echo '<a href="'.get_permalink().'">';
     356                            }
     357                        echo '<div class="aio-post-card-image-preview '.implode(" ", $this->image_visibility).'">';
     358                            echo get_the_post_thumbnail();
     359                        echo '</div>';
     360                        if($this->atts['linkable']=='yes'){
     361                            echo '</a>';
     362                        }
     363                        echo '</div>';
     364                        do_action('after_aio_large_postcard_image');
     365
     366                        echo '<div class="aio-post-card-content">';
     367
     368                        do_action('before_aio_large_postcard_title');
     369                        echo '<div class="aio-post-card-title '.implode(" ", $this->title_visibility).'">';
     370                            if($this->atts['linkable']=='yes'){
     371                                echo '<a href="'.get_permalink().'">';
     372                            }
     373                            echo '<h'.$this->atts['title_tag'].'>'.get_the_title().'</h'.$this->atts['title_tag'].'>';
     374                                if($this->atts['linkable']=='yes'){
     375                            echo '</a>';
     376                            }
     377                        echo '</div>';
     378                        do_action('after_aio_large_postcard_title');
     379
     380                        do_action('before_aio_large_postcard_excerpt');
     381                        echo '<div class="aio-post-card-excerpt '.implode(" ", $this->content_visibility).'"><p>'.substr(get_the_content(), 0, $this->atts['excerpt']);
     382                        echo '</div>';
     383                        do_action('after_aio_large_postcard_excerpt');
     384                           
     385                            do_action('before_aio_large_postcard_button');
     386                            echo '<div class="aio-post-card-main-button">';
     387                                echo '<a class="aio-post-card-button '.implode(" ", $this->button_visibility).'" href="'.get_permalink().'">'.__($this->atts['button_text'], "avada_addons").'</a>';
     388                            echo '</div>';
     389                            do_action('after_aio_large_postcard_button');
     390
     391                        echo '</div>';
     392                        echo '</div>';
     393                        do_action('after_aio_large_postcard_content');
     394                        echo '</div>';
     395
     396                } // end while
     397            } // end if
     398
     399            /**
     400             * Pagination
     401             */
     402            $this->pagination();
     403
     404                do_action('after_aio_large_postcard_inside');
     405                echo '</div>';
     406                do_action('after_aio_large_postcard');
     407
     408            unset($this->number_of_columns);
     409        }
     410
     411        function template_grid(){
     412            $this->number_of_columns();
     413
     414            do_action('before_aio_grid_postcard');
     415                echo '<div id="aio-post-card-'.$this->i.'" class="aio-post-card aio-post-card-grid">';
     416                do_action('before_aio_grid_postcard_inside');
    380417
    381418                if ( $this->posts->have_posts() ) {
    382419                    while ( $this->posts->have_posts() ) {
    383                     $this->posts->the_post();
    384 
    385                     $image_preview = get_the_post_thumbnail();
    386                     $link = get_permalink();
    387                     $title = get_the_title();
    388 
    389                         $html .= '<div id="'.$this->atts['id'].'" class="item '.$this->atts['class'].' '.implode(" ", $number_of_columns).'">';
    390 
    391                         $html .= '<div class="aio-single-post-card-content">';
    392 
    393                             $html .= '<div class="aio-post-card-image-link">';
     420                    $this->posts->the_post();
     421
     422                        echo '<div id="'.$this->atts['id'].'" class="item '.$this->atts['class'].' '.implode(" ", $this->number_of_columns).'">';
     423
     424                        echo '<div class="aio-single-post-card-content">';
     425
     426                            do_action('before_aio_grid_postcard_image');
     427                            echo '<div class="aio-post-card-image-link">';
    394428                            if($this->atts['linkable']=='yes'){
    395                                 $html .= '<a class="aio-post-card-image-link" href="'.$link.'">';
     429                                echo '<a class="aio-post-card-image-link" href="'.get_permalink().'">';
    396430                            }
    397                             $html .= '<div class="aio-post-card-image-preview '.implode(" ", $image_visibility).'">';
    398                                 $html .= $image_preview;
    399                             $html .= '</div>';
     431                            echo '<div class="aio-post-card-image-preview '.implode(" ", $this->image_visibility).'">';
     432                                echo get_the_post_thumbnail();
     433                            echo '</div>';
    400434                            if($this->atts['linkable']=='yes'){
    401                                 $html .= '</a>';
     435                                echo '</a>';
    402436                            }
    403                             $html .= '</div>';
    404 
    405                             $html .= '<div class="aio-post-card-content">';
    406 
    407                             $html .= '<div class="aio-post-card-title '.implode(" ", $title_visibility).'">';
     437                            echo '</div>';
     438                            do_action('after_aio_grid_postcard_image');
     439
     440                            do_action('before_aio_grid_postcard_content');
     441                            echo '<div class="aio-post-card-content">';
     442
     443                            do_action('before_aio_grid_postcard_title');
     444                            echo '<div class="aio-post-card-title '.implode(" ", $this->title_visibility).'">';
    408445                                if($this->atts['linkable']=='yes'){
    409                                     $html .= '<a href="'.$link.'">';
     446                                    echo '<a href="'.get_permalink().'">';
    410447                                }
    411                                 $html .= '<h'.$this->atts['title_tag'].'>'.$title.'</h'.$this->atts['title_tag'].'>';
     448                                echo '<h'.$this->atts['title_tag'].'>'.get_the_title().'</h'.$this->atts['title_tag'].'>';
    412449                                    if($this->atts['linkable']=='yes'){
    413                                 $html .= '</a>';
     450                                echo '</a>';
    414451                                }
    415                                         $html .= '</div>';
    416 
    417                             $html .= '<div class="aio-post-card-excerpt '.implode(" ", $content_visibility).'"><p>'.substr(get_the_content(), 0, $this->atts['excerpt']);
    418                                 $html .= '</div>';
    419 
    420                                 $html .= '<div class="aio-post-card-main-button">';
    421                                     $html .= '<a class="aio-post-card-button '.implode(" ", $button_visibility).'" href="'.$link.'">'.__($this->atts['button_text'], "avada_addons").'</a>';
    422                                 $html .= '</div>';
    423 
    424                             $html .= '</div>';
    425                             $html .= '</div>';
    426                             $html .= '</div>';
     452                            echo '</div>';
     453                            do_action('after_aio_grid_postcard_title');
     454
     455                            do_action('before_aio_grid_postcard_excerpt');
     456                            echo '<div class="aio-post-card-excerpt '.implode(" ", $this->content_visibility).'"><p>'.substr(get_the_content(), 0, $this->atts['excerpt']);
     457                            echo '</div>';
     458                            do_action('after_aio_grid_postcard_excerpt');
     459
     460                                do_action('before_aio_grid_postcard_button');
     461                                echo '<div class="aio-post-card-main-button">';
     462                                    echo '<a class="aio-post-card-button '.implode(" ", $this->button_visibility).'" href="'.get_permalink().'">'.__($this->atts['button_text'], "avada_addons").'</a>';
     463                                echo '</div>';
     464                                do_action('after_aio_grid_postcard_button');
     465
     466                            echo '</div>';
     467                            do_action('after_aio_grid_postcard_content');
     468                            echo '</div>';
     469                            echo '</div>';
    427470
    428471                    } // end while
    429472                } // end if
    430 
    431                 $html .= '<div class="aio-post-card-pagination '.implode(" ", $pagination_visibility).'">';
    432 
    433                 $total_pages = $this->posts->max_num_pages;
    434 
    435                 if ($total_pages > 1){
    436 
    437                     $current_page = max(1, get_query_var('paged'));
    438 
    439                     $html .= paginate_links(array(
    440                         'format'        => '?page_id='.get_queried_object_id().'&paged=%#%',   
    441                         'current'       => $current_page,
    442                         'total'         => $total_pages,
    443                         'prev_text'     => __('« '),
    444                         'next_text'     => __('»'),
    445                         'type'          => 'list',
    446                     ));
     473               
     474                /**
     475                 * Pagination
     476                 */
     477                $this->pagination();
     478
     479                do_action('after_aio_grid_postcard_inside');
     480                echo '</div>';
     481                do_action('after_aio_grid_postcard');
     482       
     483                unset($this->number_of_columns);
     484        }
     485
     486        /**
     487         * Generate pagination
     488         */
     489        function pagination(){
     490            //Pagination for alternate tempalte
     491            echo '<div class="aio-post-card-pagination '.implode(" ", $this->pagination_visibility).'">';
     492
     493            $total_pages = $this->posts->max_num_pages;
     494
     495            if ($total_pages > 1){
     496
     497                $current_page = max(1, get_query_var('paged'));
     498
     499                echo paginate_links(array(
     500                    'format'        => '?page_id='.get_queried_object_id().'&paged=%#%',   
     501                    'current'       => $current_page,
     502                    'total'         => $total_pages,
     503                    'prev_text'     => __('« '),
     504                    'next_text'     => __('»'),
     505                    'type'          => 'list',
     506                ));
    447507                   
    448508                }
    449509
    450                 $html .= '</div>';
    451 
    452                 $html .= '</div>';
    453 
    454             }
    455 
    456                 //--------------------------------------------------------->ALTERNATE TEMPLATE
    457                 if($this->atts['template'] == 'large'){
    458                     $html .= '<div id="aio-post-card-'.$this->i.'" class="aio-post-card aio-post-card-large">';
    459    
    460                     if ( $this->posts->have_posts() ) {
    461                         while ( $this->posts->have_posts() ) {
    462                         $this->posts->the_post();
    463    
    464                         $image_preview = get_the_post_thumbnail();
    465                         $link = get_permalink();
    466                         $title = get_the_title();
    467    
    468                             $html .= '<div id="'.$this->atts['id'].'" class="item '.$this->atts['class'].' '.implode(" ", $number_of_columns).'">';
    469                        
    470                             $html .= '<div class="aio-single-post-card-content">';
    471                            
    472                                 $html .= '<div class="aio-post-card-image-link">';
    473                                     if($this->atts['linkable']=='yes'){
    474                                 $html .= '<a href="'.$link.'">';
    475                                     }
    476                                 $html .= '<div class="aio-post-card-image-preview '.implode(" ", $image_visibility).'">';
    477                                     $html .= $image_preview;
    478                                 $html .= '</div>';
    479                                 if($this->atts['linkable']=='yes'){
    480                                     $html .= '</a>';
    481                                 }
    482                                 $html .= '</div>';
    483    
    484                                 $html .= '<div class="aio-post-card-content">';
    485    
    486                                 $html .= '<div class="aio-post-card-title '.implode(" ", $title_visibility).'">';
    487                                     if($this->atts['linkable']=='yes'){
    488                                         $html .= '<a href="'.$link.'">';
    489                                     }
    490                                     $html .= '<h'.$this->atts['title_tag'].'>'.$title.'</h'.$this->atts['title_tag'].'>';
    491                                         if($this->atts['linkable']=='yes'){
    492                                     $html .= '</a>';
    493                                     }
    494                                             $html .= '</div>';
    495    
    496                                 $html .= '<div class="aio-post-card-excerpt '.implode(" ", $content_visibility).'"><p>'.substr(get_the_content(), 0, $this->atts['excerpt']);
    497                                     $html .= '</div>';
    498    
    499                                     $html .= '<div class="aio-post-card-main-button">';
    500                                         $html .= '<a class="aio-post-card-button '.implode(" ", $button_visibility).'" href="'.$link.'">'.__($this->atts['button_text'], "avada_addons").'</a>';
    501                                     $html .= '</div>';
    502    
    503                                 $html .= '</div>';
    504                                 $html .= '</div>';
    505                                 $html .= '</div>';
    506    
    507                         } // end while
    508                     } // end if
    509 
    510                     $html .= '<div class="aio-post-card-pagination '.implode(" ", $pagination_visibility).'">';
    511 
    512                     $total_pages = $this->posts->max_num_pages;
    513    
    514                     if ($total_pages > 1){
    515    
    516                         $current_page = max(1, get_query_var('paged'));
    517    
    518                         $html .= paginate_links(array(
    519                             'format'        => '?page_id='.get_queried_object_id().'&paged=%#%',   
    520                             'current'       => $current_page,
    521                             'total'         => $total_pages,
    522                             'prev_text'     => __('« '),
    523                             'next_text'     => __('»'),
    524                             'type'          => 'list',
    525                         ));
    526                        
     510                echo '</div>';
     511        }
     512
     513        function number_of_columns(){
     514            //NUMBER OF COLUMN ON LARGE SCREEN
     515            switch($this->atts['columns']){
     516                case 1:
     517                    $this->number_of_columns[] = 'aio-col-lg-1';
     518                    break;
     519                case 2:
     520                    $this->number_of_columns[] = 'aio-col-lg-2';
     521                    break;
     522                case 3:
     523                    $this->number_of_columns[] = 'aio-col-lg-3';
     524                    break;
     525                case 4:
     526                    $this->number_of_columns[] = 'aio-col-lg-4';
     527                    break;
     528                case 5:
     529                    $this->number_of_columns[] = 'aio-col-lg-5';
     530                    break;
     531                case 6:
     532                    $this->number_of_columns[] = 'aio-col-lg-6';
     533                    break;
     534                }
     535                //NUMBER OF COLUMN ON MEDIUM SCREEN
     536                switch($this->atts['columns_medium']){
     537                    case 1:
     538                        $this->number_of_columns[] = 'aio-col-md-1';
     539                        break;
     540                    case 2:
     541                        $this->number_of_columns[] = 'aio-col-md-2';
     542                        break;
     543                    case 3:
     544                        $this->number_of_columns[] = 'aio-col-md-3';
     545                        break;
     546                    case 4:
     547                        $this->number_of_columns[] = 'aio-col-md-4';
     548                        break;
     549                    case 5:
     550                        $this->number_of_columns[] = 'aio-col-md-5';
     551                        break;
     552                    case 6:
     553                        $this->number_of_columns[] = 'aio-col-md-6';
     554                        break;
     555                }
     556                //NUMBER OF COLUMN ON SMALL SCREEN
     557                switch($this->atts['columns_small']){
     558                    case 1:
     559                        $this->number_of_columns[] = 'aio-col-sm-1';
     560                        break;
     561                    case 2:
     562                        $this->number_of_columns[] = 'aio-col-sm-2';
     563                        break;
     564                    case 3:
     565                        $this->number_of_columns[] = 'aio-col-sm-3';
     566                        break;
     567                    case 4:
     568                        $this->number_of_columns[] = 'aio-col-sm-4';
     569                        break;
     570                    case 5:
     571                        $this->number_of_columns[] = 'aio-col-sm-5';
     572                        break;
     573                    case 6:
     574                        $this->number_of_columns[] = 'aio-col-sm-6';
     575                        break;
    527576                    }
    528 
    529                     $html .= '</div>';
    530 
    531                     $html .= '</div>';
    532                    
    533             }
    534            
    535 
    536             /**
    537              * Call a function for css generation
    538              */
    539             $this->aio_css_generator($this->atts, $this->i);
    540 
    541             return $html;
    542577        }
    543578
  • all-in-one-avada-addons/trunk/all-in-one-avada-addons.php

    r2553478 r2553994  
    44 * Plugin URI: http://www.advisionplus.com
    55 * Description: This is an addons collection for Avada Theme.
    6  * Version: 1.1.7
     6 * Version: 1.2.0
    77 * Author: Marco Pappalardo
    88 * Author URI: http://www.marcopappalardo.it
  • all-in-one-avada-addons/trunk/assets/css/public/aio-post-card.css

    r2553475 r2553994  
    11/* Aio Post Card Css generated from aio_css_generator method in aio_credit_class */
    2 .aio-post-card {display: flex; flex-wrap: wrap; flex-direction: row;}#aio-post-card-1 .aio-post-card-image-link, #aio-post-card-1 .aio-post-card-image-link img {display: grid; width: ;}#aio-post-card-1 .item .aio-single-post-card-content{margin-top: 10px; margin-right: 10px; margin-bottom: 10px; margin-left: 10px;text-align: left;}#aio-post-card-1 .aio-post-card-title h3{text-transform:none;}#aio-post-card-1 .aio-post-card-excerpt{text-transform:none;}#aio-post-card-1 .aio-post-card-main-button a{text-transform:none;}@media (min-width: 1200px) {.aio-col-lg-4 .aio-single-post-card-content {display: grid;}#aio-post-card-1 .aio-col-lg-1 {max-width: 25%; flex: 25%;}}@media (min-width: 640px) and (max-width: 1200px) {.item.aio-col-md-4 .aio-single-post-card-content {max-width: 25%; display: grid; flex: 25%;}}@media (max-width: 640px) {.item.aio-col-sm-4 .aio-single-post-card-content {max-width: 25%; display: grid; flex: 25%;}}
     2.aio-post-card {display: flex; flex-wrap: wrap; flex-direction: row;}#aio-post-card-1 .aio-post-card-image-link {display: grid; max-width: 45%;}#aio-post-card-1 .aio-post-card-content {display: flex; flex-direction: column; margin: auto; max-width: 55%;}#aio-post-card-1 .item .aio-single-post-card-content{margin-top: 10px; margin-right: 10px; margin-bottom: 10px; margin-left: 10px;text-align: left;}#aio-post-card-1 .aio-post-card-title h3{text-transform:none;margin-left: 50px;}#aio-post-card-1 .aio-post-card-excerpt{text-transform:none;margin-right: 50px; margin-left: 50px;}#aio-post-card-1 .aio-post-card-main-button a{text-transform:none;margin-left: 50px;}#aio-post-card-1 .item:nth-child(even) .aio-single-post-card-content .aio-post-card-image-link{order: 2;} .aio-post-card-pagination {width: 100%;} .page-numbers {display: flex; flex-direction: row; padding-left: 0; } .page-numbers li {list-style: none; width: max-content;} .page-numbers li .prev,  .page-numbers li .next {display: table; padding: 0 15px;} a.page-numbers:not(.current, .prev, .next) {display: none;}@media (min-width: 1200px) {.aio-post-card-large .aio-col-lg-1 {max-width: 100%; display: flex; flex: 100%;}.aio-post-card-large .aio-col-lg-1 .aio-single-post-card-content {display: flex;}}@media (min-width: 640px) and (max-width: 1200px) {.aio-post-card-large .aio-col-md-1 {max-width: 100%; display: flex; flex: 100%;}.aio-post-card-large .aio-col-md-1 .aio-single-post-card-content {display: flex;}}@media (max-width: 640px) {.aio-post-card-large .aio-col-sm-1 {max-width: 100%; display: flex; flex: 100%;}.aio-post-card-large .aio-col-sm-1 .aio-single-post-card-content {display: flex;}}
     3.aio-post-card {display: flex; flex-wrap: wrap; flex-direction: row;}#aio-post-card-2 .aio-post-card-image-preview, #aio-post-card-2 .aio-post-card-image-preview img {display: grid; width: %;}#aio-post-card-2 .item .aio-single-post-card-content{margin-top: 10px; margin-right: 10px; margin-bottom: 10px; margin-left: 10px;text-align: left;}#aio-post-card-2 .aio-post-card-title h3{text-transform:none;}#aio-post-card-2 .aio-post-card-excerpt{text-transform:none;}#aio-post-card-2 .aio-post-card-main-button a{text-transform:none;}@media (min-width: 1200px) {.aio-post-card-grid .aio-col-lg-1 .aio-single-post-card-content {display: flex; flex-direction: column;}.aio-post-card-grid .aio-post-card-content {display:grid; height:100%;}.aio-post-card-grid .aio-post-card-main-button {align-items: flex-end; display: grid; align-content: end;}.aio-post-card-grid .aio-col-lg-1 {max-width: 100%; flex: 100%; display: flex;}}@media (min-width: 640px) and (max-width: 1200px) {.aio-post-card-grid .aio-col-md-1 .aio-single-post-card-content {display: flex; flex-direction: column;}.aio-post-card-grid .aio-post-card-content {display:grid; height:100%;}.aio-post-card-grid .aio-post-card-main-button {align-items: flex-end; display: grid; align-content: end;}.aio-post-card-grid .aio-col-md-1 {max-width: 100%; flex: 100%; display: flex;}}@media (max-width: 640px) {.aio-post-card-grid .aio-col-sm-1 .aio-single-post-card-content {display: flex; flex-direction: column;}.aio-post-card-grid .aio-post-card-content {display:grid; height:100%;}.aio-post-card-grid .aio-post-card-main-button {align-items: flex-end; display: grid; align-content: end;}.aio-post-card-grid .aio-col-sm-1 {max-width: 100%; flex: 100%; display: flex;}}
     4.aio-post-card {display: flex; flex-wrap: wrap; flex-direction: row;}#aio-post-card-3 .aio-post-card-image-preview, #aio-post-card-3 .aio-post-card-image-preview img {display: grid; width: %;}#aio-post-card-3 .item .aio-single-post-card-content{margin-top: 10px; margin-right: 10px; margin-bottom: 10px; margin-left: 10px;text-align: left;}#aio-post-card-3 .aio-post-card-title h3{text-transform:none;}#aio-post-card-3 .aio-post-card-excerpt{text-transform:none;}#aio-post-card-3 .aio-post-card-main-button a{text-transform:none;}@media (min-width: 1200px) {.aio-post-card-grid .aio-col-lg-4 .aio-single-post-card-content {display: flex; flex-direction: column;}.aio-post-card-grid .aio-post-card-content {display:grid; height:100%;}.aio-post-card-grid .aio-post-card-main-button {align-items: flex-end; display: grid; align-content: end;}.aio-post-card-grid .aio-col-lg-4 {max-width: 25%; flex: 25%; display: flex;}}@media (min-width: 640px) and (max-width: 1200px) {.aio-post-card-grid .aio-col-md-3 .aio-single-post-card-content {display: flex; flex-direction: column;}.aio-post-card-grid .aio-post-card-content {display:grid; height:100%;}.aio-post-card-grid .aio-post-card-main-button {align-items: flex-end; display: grid; align-content: end;}.aio-post-card-grid .aio-col-md-3 {max-width: 33.33%; flex: 33.33%; display: flex;}}@media (max-width: 640px) {.aio-post-card-grid .aio-col-sm-3 .aio-single-post-card-content {display: flex; flex-direction: column;}.aio-post-card-grid .aio-post-card-content {display:grid; height:100%;}.aio-post-card-grid .aio-post-card-main-button {align-items: flex-end; display: grid; align-content: end;}.aio-post-card-grid .aio-col-sm-3 {max-width: 33.33%; flex: 33.33%; display: flex;}}
  • all-in-one-avada-addons/trunk/builder-elements/post-card.php

    r2553475 r2553994  
    5050                        [
    5151                            'type'        => 'textfield',
    52                             'heading'     => esc_attr__( 'Terms', 'avada_addons' ),
     52                            'heading'     => esc_attr__( 'Terms ID', 'avada_addons' ),
    5353                            'description' => esc_attr__( 'Filter list of terms to show.', 'avada_addons' ),
    5454                            'param_name'  => 'terms',
     
    161161                            'value'       => [
    162162                                'grid'              => esc_attr__( 'Grid', 'avada_addons' ),
    163                                 'large'  => esc_attr__( 'Large', 'avada_addons' ),
     163                                'large'             => esc_attr__( 'Large', 'avada_addons' ),
    164164                            ],
    165165                            'group'       => esc_attr__( 'Design', 'avada_addons' ),
  • all-in-one-avada-addons/trunk/readme.txt

    r2449425 r2553994  
    33Donate link: marcopappalardo.it
    44Requires at least: 3.0
    5 Tested up to: 5.6
     5Tested up to: 5.7.2
    66Requires PHP: 5.6
    77License: GPLv3
     
    1414
    1515= Features List =
    16 - Woocommece Carousel for Discounted Products
    17 - Woocommece Carousel for Sest-Selling Product
    18 - Woocommerce List of products
    19 - Carousel for Custom Post Type
    20 - Post and Custom Post Type Archive
     16- Credits Area
     17- Post Card with default layouts
     18- Post carousel
     19- WooCommerce Product layouts
    2120
    2221= Add Elements by Fusion Builder =
    2322You can add individual components directly from the fusion builder. To do this you will need to search for the following elements in the builder elements:
    2423
    25 - Post Carousel by tax and term AIO
    26 - Post Archive AIO
    27 - Woocommerce Best Sellers Carousel AIO
    28 - Woocommerce On Sales Carousel AIO
     24- Credit AIO
     25- Post card AIO
     26- Post Carousel AIO
    2927- WooCommerce Product AIO
    3028
  • all-in-one-avada-addons/trunk/template/shortcode-post-card.php

    r2553478 r2553994  
    88
    99        public $aio_avada, $atts, $css, $output_css, $counter, $posts;
    10         private $display_col_type, $title_font, $pagination_visibility;
     10        private $display_col_type, $title_font, $pagination_visibility, $image_visibility, $title_visibility, $content_visibility, $button_visibility, $number_of_columns;
    1111        public $i = 0;
    1212
     
    177177                    'paged'             => get_query_var('paged'),
    178178                );
    179                 $this->posts = new WP_Query($this->args) /* get_posts($this->args) */;
     179                $this->posts = new WP_Query($args);
    180180            }
    181181   
     
    190190                    'paged'             => get_query_var('paged'),
    191191                );
    192                 $this->posts = new WP_Query($args_no_cat) /* get_posts($args_no_cat) */;
     192                $this->posts = new WP_Query($args_no_cat);
    193193            }
    194194           
     
    216216            //IMAGE VISIBILITY
    217217            if($this->atts['show_image']=='no'){
    218                 $image_visibility[] = 'aio-large-hidden';
    219             }else{
    220                 $image_visibility[] = '';
     218                $this->image_visibility[] = 'aio-large-hidden';
     219            }else{
     220                $this->image_visibility[] = '';
    221221            }
    222222            if($this->atts['show_image_medium']=='no'){
    223                 $image_visibility[] = 'aio-medium-hidden';
    224             }else{
    225                 $image_visibility[] = '';
     223                $this->image_visibility[] = 'aio-medium-hidden';
     224            }else{
     225                $this->image_visibility[] = '';
    226226            }
    227227            if($this->atts['show_image_small']=='no'){
    228                 $image_visibility[] = 'aio-small-hidden';
    229             }else{
    230                 $image_visibility[] = '';
     228                $this->image_visibility[] = 'aio-small-hidden';
     229            }else{
     230                $this->image_visibility[] = '';
    231231            }
    232232            //TITLE VISIBILITY
    233233            if($this->atts['show_title']=='no'){
    234                 $title_visibility[] = 'aio-large-hidden';
    235             }else{
    236                 $title_visibility[] = '';
     234                $this->title_visibility[] = 'aio-large-hidden';
     235            }else{
     236                $this->title_visibility[] = '';
    237237            }
    238238            if($this->atts['show_title_medium']=='no'){
    239                 $title_visibility[] = 'aio-medium-hidden';
    240             }else{
    241                 $title_visibility[] = '';
     239                $this->title_visibility[] = 'aio-medium-hidden';
     240            }else{
     241                $this->title_visibility[] = '';
    242242            }
    243243            if($this->atts['show_title_small']=='no'){
    244                 $title_visibility[] = 'aio-small-hidden';
    245             }else{
    246                 $title_visibility[] = '';
     244                $this->title_visibility[] = 'aio-small-hidden';
     245            }else{
     246                $this->title_visibility[] = '';
    247247            }
    248248            //CONTENT VISIBILITY
    249249            if($this->atts['show_content']=='no'){
    250                 $content_visibility[] = 'aio-large-hidden';
    251             }else{
    252                 $content_visibility[] = '';
     250                $this->content_visibility[] = 'aio-large-hidden';
     251            }else{
     252                $this->content_visibility[] = '';
    253253            }
    254254            if($this->atts['show_content_medium']=='no'){
    255                 $content_visibility[] = 'aio-medium-hidden';
    256             }else{
    257                 $content_visibility[] = '';
     255                $this->content_visibility[] = 'aio-medium-hidden';
     256            }else{
     257                $this->content_visibility[] = '';
    258258            }
    259259            if($this->atts['show_content_small']=='no'){
    260                 $content_visibility[] = 'aio-small-hidden';
    261             }else{
    262                 $content_visibility[] = '';
     260                $this->content_visibility[] = 'aio-small-hidden';
     261            }else{
     262                $this->content_visibility[] = '';
    263263            }
    264264            //BUTTON VISIBILITY
    265265            if($this->atts['show_button']=='no'){
    266                 $button_visibility[] = 'aio-large-hidden';
    267             }else{
    268                 $button_visibility[] = '';
     266                $this->button_visibility[] = 'aio-large-hidden';
     267            }else{
     268                $this->button_visibility[] = '';
    269269            }
    270270            if($this->atts['show_button_medium']=='no'){
    271                 $button_visibility[] = 'aio-medium-hidden';
    272             }else{
    273                 $button_visibility[] = '';
     271                $this->button_visibility[] = 'aio-medium-hidden';
     272            }else{
     273                $this->button_visibility[] = '';
    274274            }
    275275            if($this->atts['show_button_small']=='no'){
    276                 $button_visibility[] = 'aio-small-hidden';
    277             }else{
    278                 $button_visibility[] = '';
     276                $this->button_visibility[] = 'aio-small-hidden';
     277            }else{
     278                $this->button_visibility[] = '';
    279279            }
    280280            //PAGINATION VISIBILITY
    281281            if($this->atts['pagination']=='no'){
    282                 $pagination_visibility[] = 'aio-large-hidden';
    283             }else{
    284                 $pagination_visibility[] = '';
     282                $this->pagination_visibility[] = 'aio-large-hidden';
     283            }else{
     284                $this->pagination_visibility[] = '';
    285285            }
    286286            if($this->atts['pagination_medium']=='no'){
    287                 $pagination_visibility[] = 'aio-medium-hidden';
    288             }else{
    289                 $pagination_visibility[] = '';
     287                $this->pagination_visibility[] = 'aio-medium-hidden';
     288            }else{
     289                $this->pagination_visibility[] = '';
    290290            }
    291291            if($this->atts['pagination_small']=='no'){
    292                 $pagination_visibility[] = 'aio-small-hidden';
    293             }else{
    294                 $pagination_visibility[] = '';
    295             }
    296 
    297             //NUMBER OF COLUMN ON LARGE SCREEN
    298             switch($this->atts['columns']){
    299                 case 1:
    300                     $number_of_columns[] = 'aio-col-lg-1';
    301                     break;
    302                 case 2:
    303                     $number_of_columns[] = 'aio-col-lg-2';
    304                     break;
    305                 case 3:
    306                     $number_of_columns[] = 'aio-col-lg-3';
    307                     break;
    308                 case 4:
    309                     $number_of_columns[] = 'aio-col-lg-4';
    310                     break;
    311                 case 5:
    312                     $number_of_columns[] = 'aio-col-lg-5';
    313                     break;
    314                 case 6:
    315                     $number_of_columns[] = 'aio-col-lg-6';
    316                     break;
    317             }
    318             //NUMBER OF COLUMN ON MEDIUM SCREEN
    319             switch($this->atts['columns_medium']){
    320                 case 1:
    321                     $number_of_columns[] = 'aio-col-md-1';
    322                     break;
    323                 case 2:
    324                     $number_of_columns[] = 'aio-col-md-2';
    325                     break;
    326                 case 3:
    327                     $number_of_columns[] = 'aio-col-md-3';
    328                     break;
    329                 case 4:
    330                     $number_of_columns[] = 'aio-col-md-4';
    331                     break;
    332                 case 5:
    333                     $number_of_columns[] = 'aio-col-md-5';
    334                     break;
    335                 case 6:
    336                     $number_of_columns[] = 'aio-col-md-6';
    337                     break;
    338             }
    339             //NUMBER OF COLUMN ON SMALL SCREEN
    340             switch($this->atts['columns_small']){
    341                 case 1:
    342                     $number_of_columns[] = 'aio-col-sm-1';
    343                     break;
    344                 case 2:
    345                     $number_of_columns[] = 'aio-col-sm-2';
    346                     break;
    347                 case 3:
    348                     $number_of_columns[] = 'aio-col-sm-3';
    349                     break;
    350                 case 4:
    351                     $number_of_columns[] = 'aio-col-sm-4';
    352                     break;
    353                 case 5:
    354                     $number_of_columns[] = 'aio-col-sm-5';
    355                     break;
    356                 case 6:
    357                     $number_of_columns[] = 'aio-col-sm-6';
    358                     break;
    359             }
     292                $this->pagination_visibility[] = 'aio-small-hidden';
     293            }else{
     294                $this->pagination_visibility[] = '';
     295            }
     296
    360297            //COLUMNS DISPLAY TYPE
    361298            switch($this->atts['template']){
     
    369306           
    370307
    371 
    372             /**
     308            ob_start();
     309            /**
     310             * GRID TEMPLATE
    373311             * Html to renderize in frontend
    374312             * This is a custom condition and change for each of element builder type
    375313             */
    376 
    377             //--------------------------------------------------------->GRID TEMPLATE
    378314            if($this->atts['template'] == 'grid'){
    379                 $html .= '<div id="aio-post-card-'.$this->i.'" class="aio-post-card aio-post-card-grid">';
     315                $this->template_grid();
     316            }
     317
     318            /**
     319            * LARGE TEMPLATE
     320            * Html to renderize in frontend
     321            * This is a custom condition and change for each of element builder type
     322            */
     323            if($this->atts['template'] == 'large'){
     324                $this->template_large();
     325            }
     326           
     327
     328            /**
     329             * Call a function for css generation
     330             */
     331            $this->aio_css_generator($this->atts, $this->i);
     332
     333            return ob_get_clean();
     334        }
     335
     336        function template_large(){
     337            $this->number_of_columns();
     338
     339            do_action('before_aio_large_postcard');
     340            echo '<div id="aio-post-card-'.$this->i.'" class="aio-post-card aio-post-card-large">';
     341            do_action('before_aio_large_postcard_inside');
     342
     343            if ( $this->posts->have_posts() ) {
     344                while ( $this->posts->have_posts() ) {
     345                $this->posts->the_post();
     346
     347                    echo '<div id="'.$this->atts['id'].'" class="item '.$this->atts['class'].' '.implode(" ", $this->number_of_columns).'">';
     348                   
     349                    do_action('before_aio_large_postcard_content');
     350                    echo '<div class="aio-single-post-card-content">';
     351                       
     352                        do_action('before_aio_large_postcard_image');
     353                        echo '<div class="aio-post-card-image-link">';
     354                            if($this->atts['linkable']=='yes'){
     355                        echo '<a href="'.get_permalink().'">';
     356                            }
     357                        echo '<div class="aio-post-card-image-preview '.implode(" ", $this->image_visibility).'">';
     358                            echo get_the_post_thumbnail();
     359                        echo '</div>';
     360                        if($this->atts['linkable']=='yes'){
     361                            echo '</a>';
     362                        }
     363                        echo '</div>';
     364                        do_action('after_aio_large_postcard_image');
     365
     366                        echo '<div class="aio-post-card-content">';
     367
     368                        do_action('before_aio_large_postcard_title');
     369                        echo '<div class="aio-post-card-title '.implode(" ", $this->title_visibility).'">';
     370                            if($this->atts['linkable']=='yes'){
     371                                echo '<a href="'.get_permalink().'">';
     372                            }
     373                            echo '<h'.$this->atts['title_tag'].'>'.get_the_title().'</h'.$this->atts['title_tag'].'>';
     374                                if($this->atts['linkable']=='yes'){
     375                            echo '</a>';
     376                            }
     377                        echo '</div>';
     378                        do_action('after_aio_large_postcard_title');
     379
     380                        do_action('before_aio_large_postcard_excerpt');
     381                        echo '<div class="aio-post-card-excerpt '.implode(" ", $this->content_visibility).'"><p>'.substr(get_the_content(), 0, $this->atts['excerpt']);
     382                        echo '</div>';
     383                        do_action('after_aio_large_postcard_excerpt');
     384                           
     385                            do_action('before_aio_large_postcard_button');
     386                            echo '<div class="aio-post-card-main-button">';
     387                                echo '<a class="aio-post-card-button '.implode(" ", $this->button_visibility).'" href="'.get_permalink().'">'.__($this->atts['button_text'], "avada_addons").'</a>';
     388                            echo '</div>';
     389                            do_action('after_aio_large_postcard_button');
     390
     391                        echo '</div>';
     392                        echo '</div>';
     393                        do_action('after_aio_large_postcard_content');
     394                        echo '</div>';
     395
     396                } // end while
     397            } // end if
     398
     399            /**
     400             * Pagination
     401             */
     402            $this->pagination();
     403
     404                do_action('after_aio_large_postcard_inside');
     405                echo '</div>';
     406                do_action('after_aio_large_postcard');
     407
     408            unset($this->number_of_columns);
     409        }
     410
     411        function template_grid(){
     412            $this->number_of_columns();
     413
     414            do_action('before_aio_grid_postcard');
     415                echo '<div id="aio-post-card-'.$this->i.'" class="aio-post-card aio-post-card-grid">';
     416                do_action('before_aio_grid_postcard_inside');
    380417
    381418                if ( $this->posts->have_posts() ) {
    382419                    while ( $this->posts->have_posts() ) {
    383                     $this->posts->the_post();
    384 
    385                     $image_preview = get_the_post_thumbnail();
    386                     $link = get_permalink();
    387                     $title = get_the_title();
    388 
    389                         $html .= '<div id="'.$this->atts['id'].'" class="item '.$this->atts['class'].' '.implode(" ", $number_of_columns).'">';
    390 
    391                         $html .= '<div class="aio-single-post-card-content">';
    392 
    393                             $html .= '<div class="aio-post-card-image-link">';
     420                    $this->posts->the_post();
     421
     422                        echo '<div id="'.$this->atts['id'].'" class="item '.$this->atts['class'].' '.implode(" ", $this->number_of_columns).'">';
     423
     424                        echo '<div class="aio-single-post-card-content">';
     425
     426                            do_action('before_aio_grid_postcard_image');
     427                            echo '<div class="aio-post-card-image-link">';
    394428                            if($this->atts['linkable']=='yes'){
    395                                 $html .= '<a class="aio-post-card-image-link" href="'.$link.'">';
     429                                echo '<a class="aio-post-card-image-link" href="'.get_permalink().'">';
    396430                            }
    397                             $html .= '<div class="aio-post-card-image-preview '.implode(" ", $image_visibility).'">';
    398                                 $html .= $image_preview;
    399                             $html .= '</div>';
     431                            echo '<div class="aio-post-card-image-preview '.implode(" ", $this->image_visibility).'">';
     432                                echo get_the_post_thumbnail();
     433                            echo '</div>';
    400434                            if($this->atts['linkable']=='yes'){
    401                                 $html .= '</a>';
     435                                echo '</a>';
    402436                            }
    403                             $html .= '</div>';
    404 
    405                             $html .= '<div class="aio-post-card-content">';
    406 
    407                             $html .= '<div class="aio-post-card-title '.implode(" ", $title_visibility).'">';
     437                            echo '</div>';
     438                            do_action('after_aio_grid_postcard_image');
     439
     440                            do_action('before_aio_grid_postcard_content');
     441                            echo '<div class="aio-post-card-content">';
     442
     443                            do_action('before_aio_grid_postcard_title');
     444                            echo '<div class="aio-post-card-title '.implode(" ", $this->title_visibility).'">';
    408445                                if($this->atts['linkable']=='yes'){
    409                                     $html .= '<a href="'.$link.'">';
     446                                    echo '<a href="'.get_permalink().'">';
    410447                                }
    411                                 $html .= '<h'.$this->atts['title_tag'].'>'.$title.'</h'.$this->atts['title_tag'].'>';
     448                                echo '<h'.$this->atts['title_tag'].'>'.get_the_title().'</h'.$this->atts['title_tag'].'>';
    412449                                    if($this->atts['linkable']=='yes'){
    413                                 $html .= '</a>';
     450                                echo '</a>';
    414451                                }
    415                                         $html .= '</div>';
    416 
    417                             $html .= '<div class="aio-post-card-excerpt '.implode(" ", $content_visibility).'"><p>'.substr(get_the_content(), 0, $this->atts['excerpt']);
    418                                 $html .= '</div>';
    419 
    420                                 $html .= '<div class="aio-post-card-main-button">';
    421                                     $html .= '<a class="aio-post-card-button '.implode(" ", $button_visibility).'" href="'.$link.'">'.__($this->atts['button_text'], "avada_addons").'</a>';
    422                                 $html .= '</div>';
    423 
    424                             $html .= '</div>';
    425                             $html .= '</div>';
    426                             $html .= '</div>';
     452                            echo '</div>';
     453                            do_action('after_aio_grid_postcard_title');
     454
     455                            do_action('before_aio_grid_postcard_excerpt');
     456                            echo '<div class="aio-post-card-excerpt '.implode(" ", $this->content_visibility).'"><p>'.substr(get_the_content(), 0, $this->atts['excerpt']);
     457                            echo '</div>';
     458                            do_action('after_aio_grid_postcard_excerpt');
     459
     460                                do_action('before_aio_grid_postcard_button');
     461                                echo '<div class="aio-post-card-main-button">';
     462                                    echo '<a class="aio-post-card-button '.implode(" ", $this->button_visibility).'" href="'.get_permalink().'">'.__($this->atts['button_text'], "avada_addons").'</a>';
     463                                echo '</div>';
     464                                do_action('after_aio_grid_postcard_button');
     465
     466                            echo '</div>';
     467                            do_action('after_aio_grid_postcard_content');
     468                            echo '</div>';
     469                            echo '</div>';
    427470
    428471                    } // end while
    429472                } // end if
    430 
    431                 $html .= '<div class="aio-post-card-pagination '.implode(" ", $pagination_visibility).'">';
    432 
    433                 $total_pages = $this->posts->max_num_pages;
    434 
    435                 if ($total_pages > 1){
    436 
    437                     $current_page = max(1, get_query_var('paged'));
    438 
    439                     $html .= paginate_links(array(
    440                         'format'        => '?page_id='.get_queried_object_id().'&paged=%#%',   
    441                         'current'       => $current_page,
    442                         'total'         => $total_pages,
    443                         'prev_text'     => __('« '),
    444                         'next_text'     => __('»'),
    445                         'type'          => 'list',
    446                     ));
     473               
     474                /**
     475                 * Pagination
     476                 */
     477                $this->pagination();
     478
     479                do_action('after_aio_grid_postcard_inside');
     480                echo '</div>';
     481                do_action('after_aio_grid_postcard');
     482       
     483                unset($this->number_of_columns);
     484        }
     485
     486        /**
     487         * Generate pagination
     488         */
     489        function pagination(){
     490            //Pagination for alternate tempalte
     491            echo '<div class="aio-post-card-pagination '.implode(" ", $this->pagination_visibility).'">';
     492
     493            $total_pages = $this->posts->max_num_pages;
     494
     495            if ($total_pages > 1){
     496
     497                $current_page = max(1, get_query_var('paged'));
     498
     499                echo paginate_links(array(
     500                    'format'        => '?page_id='.get_queried_object_id().'&paged=%#%',   
     501                    'current'       => $current_page,
     502                    'total'         => $total_pages,
     503                    'prev_text'     => __('« '),
     504                    'next_text'     => __('»'),
     505                    'type'          => 'list',
     506                ));
    447507                   
    448508                }
    449509
    450                 $html .= '</div>';
    451 
    452                 $html .= '</div>';
    453 
    454             }
    455 
    456                 //--------------------------------------------------------->ALTERNATE TEMPLATE
    457                 if($this->atts['template'] == 'large'){
    458                     $html .= '<div id="aio-post-card-'.$this->i.'" class="aio-post-card aio-post-card-large">';
    459    
    460                     if ( $this->posts->have_posts() ) {
    461                         while ( $this->posts->have_posts() ) {
    462                         $this->posts->the_post();
    463    
    464                         $image_preview = get_the_post_thumbnail();
    465                         $link = get_permalink();
    466                         $title = get_the_title();
    467    
    468                             $html .= '<div id="'.$this->atts['id'].'" class="item '.$this->atts['class'].' '.implode(" ", $number_of_columns).'">';
    469                        
    470                             $html .= '<div class="aio-single-post-card-content">';
    471                            
    472                                 $html .= '<div class="aio-post-card-image-link">';
    473                                     if($this->atts['linkable']=='yes'){
    474                                 $html .= '<a href="'.$link.'">';
    475                                     }
    476                                 $html .= '<div class="aio-post-card-image-preview '.implode(" ", $image_visibility).'">';
    477                                     $html .= $image_preview;
    478                                 $html .= '</div>';
    479                                 if($this->atts['linkable']=='yes'){
    480                                     $html .= '</a>';
    481                                 }
    482                                 $html .= '</div>';
    483    
    484                                 $html .= '<div class="aio-post-card-content">';
    485    
    486                                 $html .= '<div class="aio-post-card-title '.implode(" ", $title_visibility).'">';
    487                                     if($this->atts['linkable']=='yes'){
    488                                         $html .= '<a href="'.$link.'">';
    489                                     }
    490                                     $html .= '<h'.$this->atts['title_tag'].'>'.$title.'</h'.$this->atts['title_tag'].'>';
    491                                         if($this->atts['linkable']=='yes'){
    492                                     $html .= '</a>';
    493                                     }
    494                                             $html .= '</div>';
    495    
    496                                 $html .= '<div class="aio-post-card-excerpt '.implode(" ", $content_visibility).'"><p>'.substr(get_the_content(), 0, $this->atts['excerpt']);
    497                                     $html .= '</div>';
    498    
    499                                     $html .= '<div class="aio-post-card-main-button">';
    500                                         $html .= '<a class="aio-post-card-button '.implode(" ", $button_visibility).'" href="'.$link.'">'.__($this->atts['button_text'], "avada_addons").'</a>';
    501                                     $html .= '</div>';
    502    
    503                                 $html .= '</div>';
    504                                 $html .= '</div>';
    505                                 $html .= '</div>';
    506    
    507                         } // end while
    508                     } // end if
    509 
    510                     $html .= '<div class="aio-post-card-pagination '.implode(" ", $pagination_visibility).'">';
    511 
    512                     $total_pages = $this->posts->max_num_pages;
    513    
    514                     if ($total_pages > 1){
    515    
    516                         $current_page = max(1, get_query_var('paged'));
    517    
    518                         $html .= paginate_links(array(
    519                             'format'        => '?page_id='.get_queried_object_id().'&paged=%#%',   
    520                             'current'       => $current_page,
    521                             'total'         => $total_pages,
    522                             'prev_text'     => __('« '),
    523                             'next_text'     => __('»'),
    524                             'type'          => 'list',
    525                         ));
    526                        
     510                echo '</div>';
     511        }
     512
     513        function number_of_columns(){
     514            //NUMBER OF COLUMN ON LARGE SCREEN
     515            switch($this->atts['columns']){
     516                case 1:
     517                    $this->number_of_columns[] = 'aio-col-lg-1';
     518                    break;
     519                case 2:
     520                    $this->number_of_columns[] = 'aio-col-lg-2';
     521                    break;
     522                case 3:
     523                    $this->number_of_columns[] = 'aio-col-lg-3';
     524                    break;
     525                case 4:
     526                    $this->number_of_columns[] = 'aio-col-lg-4';
     527                    break;
     528                case 5:
     529                    $this->number_of_columns[] = 'aio-col-lg-5';
     530                    break;
     531                case 6:
     532                    $this->number_of_columns[] = 'aio-col-lg-6';
     533                    break;
     534                }
     535                //NUMBER OF COLUMN ON MEDIUM SCREEN
     536                switch($this->atts['columns_medium']){
     537                    case 1:
     538                        $this->number_of_columns[] = 'aio-col-md-1';
     539                        break;
     540                    case 2:
     541                        $this->number_of_columns[] = 'aio-col-md-2';
     542                        break;
     543                    case 3:
     544                        $this->number_of_columns[] = 'aio-col-md-3';
     545                        break;
     546                    case 4:
     547                        $this->number_of_columns[] = 'aio-col-md-4';
     548                        break;
     549                    case 5:
     550                        $this->number_of_columns[] = 'aio-col-md-5';
     551                        break;
     552                    case 6:
     553                        $this->number_of_columns[] = 'aio-col-md-6';
     554                        break;
     555                }
     556                //NUMBER OF COLUMN ON SMALL SCREEN
     557                switch($this->atts['columns_small']){
     558                    case 1:
     559                        $this->number_of_columns[] = 'aio-col-sm-1';
     560                        break;
     561                    case 2:
     562                        $this->number_of_columns[] = 'aio-col-sm-2';
     563                        break;
     564                    case 3:
     565                        $this->number_of_columns[] = 'aio-col-sm-3';
     566                        break;
     567                    case 4:
     568                        $this->number_of_columns[] = 'aio-col-sm-4';
     569                        break;
     570                    case 5:
     571                        $this->number_of_columns[] = 'aio-col-sm-5';
     572                        break;
     573                    case 6:
     574                        $this->number_of_columns[] = 'aio-col-sm-6';
     575                        break;
    527576                    }
    528 
    529                     $html .= '</div>';
    530 
    531                     $html .= '</div>';
    532                    
    533             }
    534            
    535 
    536             /**
    537              * Call a function for css generation
    538              */
    539             $this->aio_css_generator($this->atts, $this->i);
    540 
    541             return $html;
    542577        }
    543578
Note: See TracChangeset for help on using the changeset viewer.