Extra Phlox theme Shortcodes

Below, you’ll find a detailed guide on how to add the Shortcodes and extra features for Phlox theme Shortcodes to your WordPress website, including their parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the Shortcodes and extra features for Phlox theme Plugin shortcodes not to show or not to work correctly.

Before starting, here is an overview of the Shortcodes and extra features for Phlox theme Plugin and the shortcodes it provides:

Plugin Icon
Shortcodes and extra features for Phlox theme

"Shortcodes and Extra Features for Phlox Theme is a comprehensive WordPress plugin that boosts your Phlox theme functionalities by providing a variety of shortcodes and additional features."

★★✩✩✩ (6) Active Installs: 100000+ Tested with: 6.2.0 PHP Version: 5.4
Included Shortcodes:
  • [aux_accordion_tab]
  • [aux_attach_url]
  • [aux_responsive_image_tag]
  • [aux_timeline]
  • [aux_row]
  • [aux_col]

Phlox [aux_accordion_tab] Shortcode

The ‘aux_accordion_tab’ shortcode from Auxin Elements plugin is designed to create an accordion-style tab. This tab can expand and collapse, displaying content when opened. The shortcode takes a ‘label’ attribute, which sets the tab’s title. The content within the tab is defined by the enclosed content of the shortcode. This allows for flexible, dynamic content presentation.

Shortcode: [aux_accordion_tab]

Parameters

Here is a list of all possible aux_accordion_tab shortcode parameters and attributes:

  • label – defines the title of the accordion tab
  • content – sets the text/content inside the accordion tab

Examples and Usage

Basic example – A simple usage of the ‘aux_accordion_tab’ shortcode which displays an accordion tab with a default label.

[aux_accordion_tab][/aux_accordion_tab]

PHP Function Code

In case you have difficulties debugging what causing issues with [aux_accordion_tab] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode('aux_accordion_tab', 'auxin_accordion_tab_shortcode');

Shortcode PHP function:

function auxin_accordion_tab_shortcode( $atts, $content = null ) {

    $output = '';

    extract( shortcode_atts(
        array(
            "label" => 'Label'
        ), $atts )
    );
    $output .= '<section>';
    $output .= '<h6 class="toggle-header">' . $label . '</h6>';
    $output .= '<div class="toggle-content"><p>' . $content . '</p></div>';
    $output .= '</section>';

    return $output;
}

Code file location:

auxin-elements/auxin-elements/includes/elements/accordion-widget.php

Phlox [aux_attach_url] Shortcode

The ‘aux_attach_url’ shortcode from Auxin-Elements plugin is used to fetch and return the URL of an attachment. This shortcode takes an ‘id’ as an attribute, which corresponds to the id of the attachment. If the ‘id’ is not provided or empty, it returns nothing. If the ‘id’ is valid, it uses the WordPress function ‘wp_get_attachment_url’ to return the URL of the attachment.

Shortcode: [aux_attach_url]

Parameters

Here is a list of all possible aux_attach_url shortcode parameters and attributes:

  • id – Identifier to specify the attachment’s unique ID

Examples and Usage

Basic example – The shortcode ‘aux_attach_url’ is used to fetch a URL of an attachment by referencing its ID.

[aux_attach_url id=123 /]

Advanced examples

Example 1 – The shortcode ‘aux_attach_url’ can also be used within other shortcodes or WordPress functions. Here, we are using it within the ‘caption’ shortcode to display an image with its caption. The ‘id’ attribute in ‘aux_attach_url’ shortcode is used to fetch the URL of the image.

" align="alignnone"] This is an image caption. [/caption]

Example 2 – The ‘aux_attach_url’ shortcode can be used in conjunction with the WordPress ‘do_shortcode’ function to execute the shortcode within a PHP file. In the following example, we are fetching the URL of an attachment and assigning it to a variable.

<?php $attachment_url = do_shortcode('[aux_attach_url id=123 /]'); ?>

PHP Function Code

In case you have difficulties debugging what causing issues with [aux_attach_url] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'aux_attach_url', 'auxin_shortcode_attach_id' );

Shortcode PHP function:

function auxin_shortcode_attach_id( $atts, $content = null ) {
    extract( shortcode_atts( array( 'id' => '' ) , $atts ) );
    if( empty( $id ) ){
        return '';
    }
    return wp_get_attachment_url( $id );
}

Code file location:

auxin-elements/auxin-elements/includes/elements/attachment-url.php

Phlox [aux_responsive_image_tag] Shortcode

The Auxin Responsive Image Tag shortcode is a powerful tool in the Auxin Elements plugin. It allows you to generate responsive images in WordPress. This shortcode enables you to customize image attributes such as quality, preloading, size, and cropping. It automatically calculates image sizes based on the ‘size’ parameter or generates image sources based on WP default image sizes. It also provides options for preloading images, adding hardware acceleration, and customizing the extra class for additional CSS. If the ‘id’ attribute is not provided, the shortcode will return an empty string.

Shortcode: [aux_responsive_image_tag]

Parameters

Here is a list of all possible aux_responsive_image_tag shortcode parameters and attributes:

  • id – The unique ID of the image to be displayed.
  • quality – Sets the image quality, default is 100.
  • preloadable – If true, image is ready for preloading.
  • preload_preview – If true, a low-quality placeholder is inserted until the main image loads.
  • upscale – If true, the image can be upscaled.
  • size – Defines the size of the image, default is ‘large’.
  • crop – If not null, the image will be cropped.
  • add_hw – If true, image height and width are added.
  • add_ratio – If true, the aspect ratio of the image is added.
  • sizes – Defines the sizes of the image, default is ‘auto’.
  • srcset – Defines the source set of the image, default is ‘auto’.
  • original_src – If true, the original source of the image is used.
  • extra_class – Adds extra CSS classes to the image.

Examples and Usage

Basic example – Display a responsive image with a specific ID

[aux_responsive_image_tag id=123 /]

Advanced examples

Display a responsive image with a specific ID, set the quality to 80, and disable the preloading feature.

[aux_responsive_image_tag id=123 quality=80 preloadable=false /]

Display a responsive image with a specific ID, set the size to ‘medium’, and enable the upscaling feature.

[aux_responsive_image_tag id=123 size=medium upscale=true /]

Display a responsive image with a specific ID, set the image sizes automatically based on the ‘size’ parameter, and generate image srcs based on WP default image sizes.

[aux_responsive_image_tag id=123 sizes=auto srcset=wp /]

Display a responsive image with a specific ID and add an extra CSS class to it.

[aux_responsive_image_tag id=123 extra_class="my-custom-class" /]

PHP Function Code

In case you have difficulties debugging what causing issues with [aux_responsive_image_tag] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'aux_responsive_image_tag', 'auxin_shortcode_responsive_image_tag' );

Shortcode PHP function:

function auxin_shortcode_responsive_image_tag( $atts, $content = null ) {

    $attrs = shortcode_atts(
        array(
            'id'              => '',
            'quality'         => 100,
            'preloadable'     => true, // Set it to "true" or "null" in order make the image ready for preloading, "true" will load the best match as well.
            'preload_preview' => true, // (true, false, 'progress') if true, insert a low quality placeholder until lazyloading the main image. If set to progress, display a progress animation as a placeholder.
            'upscale'         => false,
            'size'            => 'large',
            'crop'            => null,
            'add_hw'          => true,
            'add_ratio'       => true,
            'sizes'           => 'auto', // (sizes)
            'srcset'          => 'auto', // (srcset) automatically calculate the image sizes based on the 'size' param, OR 'wp' generates image srcs based on WP default image sizes
            'original_src'    => true,
            'extra_class'     => ''
        ),
    $atts );


    if( empty( $attrs['id'] ) ){
        return '';
    }

    return auxin_get_the_responsive_attachment( $attrs['id'], $attrs );
}

Code file location:

auxin-elements/auxin-elements/includes/elements/attachment-url.php

Phlox [aux_timeline] Shortcode

The Auxin Timeline shortcode is used to display a timeline of posts on a page. It allows customization of timeline attributes like section size, header title, number of columns, view more option, number of posts to fetch, excerpt length, category ID, thumbnail view and more.

Shortcode: [aux_timeline]

Parameters

Here is a list of all possible aux_timeline shortcode parameters and attributes:

  • size – Defines the section size of the timeline widget
  • title – Sets the header title of the timeline widget
  • col – Determines the number of columns in the timeline
  • view_more – Decides whether to display the ‘view all’ button
  • more_label – Sets the label for the ‘view all’ button
  • num – Specifies the number of items to fetch for the timeline
  • excerpt_len – Defines the length of the excerpt for each item
  • cat_id – Specifies the category ID to display items from
  • view_thumb – Decides whether to display thumbnail or not
  • thumb_mode – Sets the mode of thumbnail display
  • date_type – Determines the format of the date display
  • orderby – Sets the order of the items by a specific parameter
  • order – Sets the order of the items (ascending or descending)
  • layout – Determines the layout of the timeline widget

Examples and Usage

Basic example – Displaying a timeline with default settings

[aux_timeline /]

Advanced examples

Displaying a timeline with a specific title and showing 10 posts

[aux_timeline title="My Timeline" num=10 /]

Displaying a timeline from a specific category, with thumbnails on the left and a ‘View All’ button

[aux_timeline cat_id="5" view_thumb="yes" view_more="yes" thumb_mode="left" /]

Displaying a timeline sorted by title in ascending order, with a specific excerpt length

[aux_timeline orderby="title" order="ASC" excerpt_len="100" /]

Displaying a timeline with a specific size and column configuration

[aux_timeline size="150" col="50" /]

PHP Function Code

In case you have difficulties debugging what causing issues with [aux_timeline] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'aux_timeline'    , 'auxin_shortcode_timeline' );

Shortcode PHP function:

function auxin_shortcode_timeline( $atts, $content = null ) {

   // extract attrs to vars
   extract( shortcode_atts(
        array(
            'size'        =>  100, // section size
            'title'       => '', // widget header title
            'col'         => '33', // one .. six-column
            'view_more'   => 'yes',
            'more_label'  => 'view all',
            'num'         =>  5,  // fetch num
            'excerpt_len' => '120',
            'cat_id'      => '', // cat id to display. '' gets all cats
            'view_thumb'  => 'yes', // display thumbnail or not
            'thumb_mode'  => 'left', // 'top': normal thumb on top , 'left': normal thumb on left, 'icon': icon size thumb
            'date_type'   => 'big',
            'orderby'     => '',
            'order'       => '',
            'layout'      => 'center'
        )
        , $atts, 'aux_timeline' )
    );

    // sanitize sql order and orderby
    $orderby = $orderby ? sanitize_sql_orderby( $orderby ) : 'date';
    $order   = $order   ? auxin_sanitize_sql_order(   $order   ) : 'DESC';

    // validate number fetched items
    $num = is_numeric( $num ) ? $num : -1;

    // get thumbnail diemntion --------------------------------------
    $vimeo_height = 273;

    // chane thumbnail size to 60x60 if it is mini mode
    if($thumb_mode == "mini") {
        $dimentions[0] = 60;
        $dimentions[1] = 60;
    }else{
        // actual col size
        // get number of grid column
        $wrapper_size = empty($size)?100:$size;
        $col_actual = ($wrapper_size / 100) * (int)$col;
        $col_num = floor(100 / $col_actual);
        $col_num = $col_num > 4?4:$col_num; // max column num is 4
        // get thumbnsil size name
        $image_size_name = "i".$col_num;

        // get suite thumb size
        $thumb_size = $image_size_name;
        $dimentions = auxin_get_image_size( $thumb_size.'_1' );

        // the left mode is half size of top mode, so for making image retina
        // bigger size is not needed
        if($thumb_mode == "top"){
            // retinafy thumbnail
            $dimentions[0] =  1.5 * $dimentions[0];
            $dimentions[1] =  1.5 * ($dimentions[1] - 10);

        }else{ // if the image is on left
            $dimentions[1] -= 10;
        }

    }


    // just view custom taxonomies if tax id is set ----------------
    $tax_args = array('taxonomy' => 'category', 'terms' => $cat_id );
    if(empty($cat_id) || $cat_id == "all" ) $tax_args = "";

    // create wp_query to get latest items
    $args = array(
        'post_type'         => 'post',
        'orderby'           => $orderby,
        'order'             => $order,
        'post_status'       => 'publish',
        'posts_per_page'    => $num,
        'ignore_sticky_posts'=> 1,
        'tax_query'         => array($tax_args)
    );

    $th_query = null;
    $th_query = new WP_Query($args);



    ob_start();
?>

        <section class="widget-blog widget-container widget-timeline" >

           <?php

           if( ! empty($title) )
                echo get_widget_title( $title ); ?>


           <div class="widget-inner">
                <div class="aux-timeline aux-<?php echo esc_attr( $layout ); ?>" data-layout="<?php echo esc_attr( $layout ); ?>" >

<?php if( $th_query->have_posts() ):  while ($th_query->have_posts()) : $th_query->the_post(); ?>




<?php
    $post_format = get_post_format($th_query->post->ID);
    $has_attach  = FALSE;
    $the_attach  = "";
    $show_title  = true;

    switch ($post_format) {
        case 'aside':

            break;
        case 'gallery':

            // if the mode is not mini size
            if($thumb_mode != "mini") {
                // if post has featured image, use featured image instead of gallery images
                $has_attach = has_post_thumbnail($th_query->post->ID);
                if($has_attach) {
                    $the_attach = auxin_get_the_post_thumbnail($th_query->post->ID, $dimentions[0], $dimentions[1], true, 75);

                    $the_media = '<div class="imgHolder">'.
                                    '<a href="'.auxin_get_the_attachment_url($th_query->post->ID, "full").'" data-rel="prettyPhoto">'.
                                        $the_attach.
                                    '</a>'.
                                 '</div>';

                // display gallery images as slider if featured image is not set
                } else {

                    $slider  = '[flexslider slideshow="no" effect="slide" nav_type="none" easing="easeInOutQuad" ]';
                    $has_attach = false;

                    for ($i=1; $i <= 5; $i++) {
                        $img_url = get_post_meta($th_query->post->ID, "axi_gallery_image".$i, true);
                        if(!empty($img_url) ){
                            $has_attach = true;
                            $img_url = auxin_get_the_absolute_image_url($img_url);
                            $slider .= '[simple_slide src="'.auxin_get_the_resized_image_src($img_url, $dimentions[0], $dimentions[1], true, 75 ).'"  ]';
                        }
                    }

                    $slider .= '[/flexslider]';
                    if(!$has_attach) break;

                    $the_media = do_shortcode($slider);
                }

                break;

            // if thumb mode is mini, just echo small image intead of slider
            }else {
                $has_attach = has_post_thumbnail($th_query->post->ID);
                // if post has featured image, use featured image instead of gallery image
                if( $has_attach ) {
                    $the_attach = auxin_get_the_post_thumbnail_src($th_query->post->ID, $dimentions[0], $dimentions[1], true, 75);

                // display first gallery image as slider if featured image is not set
                }else {
                    $the_attach = get_post_meta($th_query->post->ID, "axi_gallery_image1", true);
                    $has_attach = !empty($the_attach);
                    if(!$has_attach) break;
                    $the_attach = auxin_get_the_absolute_image_url($the_attach);
                }

                $the_media = '<div class="imgHolder">'.
                                '<a href="'.get_permalink().'" >'.
                                    '<img src="'.$the_attach.'" alt="" />'.
                                '</a>'.
                             '</div>';
                break;
            }

            break;
        case 'image':
            $has_attach = has_post_thumbnail();
            if(!$has_attach) break;
            $the_attach = auxin_get_the_post_thumbnail($th_query->post->ID, $dimentions[0], $dimentions[1], true, 75);

            $the_media = '<div class="imgHolder">'.
                            '<a href="'.auxin_get_the_attachment_url($th_query->post->ID, "full").'" data-rel="prettyPhoto">'.
                                $the_attach.
                            '</a>'.
                         '</div>';
            break;

        case 'link':
            $the_link = get_post_meta($th_query->post->ID, "the_link", true);
            $show_title = TRUE;
            $has_attach = false;
            if(!$has_attach) break;
            break;

        case 'video':
            $video_link = get_post_meta($th_query->post->ID, "youtube", true);
            $mp4        = get_post_meta($th_query->post->ID, "mp4" , true);
            $ogg        = get_post_meta($th_query->post->ID, "ogg" , true);
            $webm       = get_post_meta($th_query->post->ID, "webm", true);
            $flv        = get_post_meta($th_query->post->ID, "flv" , true);
            $poster     = get_post_meta($th_query->post->ID, "poster", true);
            $skin       = get_post_meta($th_query->post->ID, "skin"  , true);

            // if it is mini size just display a thumbnail
            if($thumb_mode == "mini") {
                if(has_post_thumbnail()){
                    $the_attach = auxin_get_the_post_thumbnail($th_query->post->ID, $dimentions[0], $dimentions[1], true, 75);
                    $the_media = '<div class="imgHolder">'.
                                    '<a href="'.get_permalink().'">'.
                                        $the_attach.
                                    '</a>'.
                                 '</div>';
                }
                break;
            }

            // if the feature image is set, display feature image instead
            $has_attach = has_post_thumbnail();
            if($has_attach) {
                $the_attach = auxin_get_the_post_thumbnail($th_query->post->ID, $dimentions[0], $dimentions[1], true, 75);

                $the_media = '<div class="imgHolder">'.
                                '<a href="'.get_permalink().'" >'.
                                    $the_attach.
                                '</a>'.
                             '</div>';
                break;
            }

            $has_attach = (!empty($video_link) || !empty($mp4) || !empty($ogg) || !empty($webm) || !empty($flv));
            if(!$has_attach) break;

            $the_attach = do_shortcode('[video_element fit="yes" height="'.$vimeo_height.'" url="'.$video_link.'" mp4="'.$mp4.'" ogg="'.$ogg.'" webm="'.$webm.'" flv="'.$flv.'" poster="'.$poster.'" skin="'.$skin.'" uid="axi_vid'.$th_query->post->ID.'" size="0" ]');

            $the_media = $the_attach;
            echo '<style type="text/css"> div.jp-video div.jp-jplayer { min-height: '.(($dimentions[1]/2)-75).'px; }</style>';
            unset($video_link, $mp4,$ogg,$webm,$flv,$poster);
            break;

        case 'audio':
            $mp3        = get_post_meta($th_query->post->ID, "mp3" , true);
            $oga        = get_post_meta($th_query->post->ID, "oga" , true);
            $skin       = get_post_meta($th_query->post->ID, "audio_skin"  , true);
            $soundcloud = get_post_meta($th_query->post->ID, "soundcloud"  , true);

            if($thumb_mode == "mini") {
                if(has_post_thumbnail()){
                    $the_attach = auxin_get_the_post_thumbnail($th_query->post->ID, $dimentions[0], $dimentions[1], true, 75);
                    $the_media = '<div class="imgHolder">'.
                                    '<a href="'.get_permalink().'">'.
                                        $the_attach.
                                    '</a>'.
                                 '</div>';
                }
                break;
            }

            $has_attach = (!empty($mp3) || !empty($oga) || !empty($soundcloud));
            if(!$has_attach) break;
            if(!empty($mp3) || !empty($oga))
                $the_attach = do_shortcode('[audio mp3="'.$mp3.'" ogg="'.$oga.'" skin="'.$skin.'" uid="axi_au'.$th_query->post->ID.'" size="0" ]');
            else
                $the_attach = do_shortcode($soundcloud);
            $the_media = $the_attach;
            unset($mp3,$oga,$skin, $soundcloud);
            break;


        case 'quote':
            $quote  = get_the_excerpt();
            $author = get_post_meta($th_query->post->ID, "the_author", true);
            $show_title = false;
            $has_attach = false;
            $quote  = auxin_get_trimmed_string($quote,$excerpt_len, " ...");
            $quote .= "<br/>- <cite>".$author."</cite>";
            $the_attach = do_shortcode('[blockquote size="0" indent="no" ]'.$quote.'[/blockquote]');
            unset($quote);
            break;

        default:
            $has_attach = has_post_thumbnail();
            if(!$has_attach) {
                $the_attach = auxin_get_first_image_from_string(get_the_content());
                $has_attach = !empty($the_attach);
            }else {
                $the_attach = auxin_get_the_post_thumbnail($th_query->post->ID, $dimentions[0], $dimentions[1], true, 75);
            }

            if(!$has_attach) break;

            $the_media = '<div class="imgHolder">'.
                            '<a href="'.get_permalink().'">'.
                                $the_attach.
                            '</a>'.
                         '</div>';
            break;
    }

?>

                    <article class="aux-block <?php echo "date-type-".$date_type." "; echo ($thumb_mode != "top")? $thumb_mode : "thumb_top" ; ?>">
                       <figure>
                           <?php if ( $has_attach  && ($view_thumb == "yes") ) {
                                echo wp_kses_post( $the_media );
                            } ?>


                            <figcaption>
                                <div class="entry-header">
                                    <h4 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
                                    <div class="entry-format">
                                        <a href="<?php the_permalink(); ?>" class="post-format format-<?php echo get_post_format(); ?>"> </a>
                                        <?php if($date_type == "big") { ?>
                                        <div class="cell-date">
                                            <em> </em><em> </em>
                                            <time datetime="<?php echo get_the_date( DATE_W3C ); ?>" title="<?php echo get_the_date( DATE_W3C ); ?>" >
                                                <strong><?php the_time('d')?></strong>
                                                <span><?php the_time('M')?></span>
                                            </time>
                                        </div>
                                        <?php } ?>
                                    </div>
                                </div>

                                <div class="entry-content">
                                    <?php if($date_type == "inline" && $post_format != "quote") { ?>
                                    <time datetime="<?php echo get_the_date( DATE_W3C ); ?>" title="<?php echo get_the_date( DATE_W3C ); ?>" ><?php the_date(); ?></time>
                                    <?php } ?>

                                    <?php if($post_format == "quote") {
                                        echo wp_kses_post( $the_attach );
                                    } elseif($excerpt_len > 0) { ?>
                                    <p><?php auxin_the_trimmed_string(get_the_excerpt(),$excerpt_len); ?></p>
                                    <?php } ?>
                                </div>
                            </figcaption>
                       </figure>
                   </article><!-- end-timeline-block -->

<?php   endwhile; endif;
    wp_reset_query();
?>
                </div><!-- end-timeline-wrapper -->
            </div><!-- widget-inner -->

            <?php if($view_more == "yes" ) {
                $view_all_link = esc_url( auxin_get_option( 'blog_view_all_btn_link', home_url() ) );
            ?>
            <a href="<?php echo esc_url( $view_all_link ); ?>" class="more right" ><?php echo auxin_kses( $more_label ); ?></a>
            <?php } unset( $view_all_link ); ?>

        </section><!-- widget-blog -->

<?php
    return ob_get_clean();
}

Code file location:

auxin-elements/auxin-elements/includes/general-shortcodes.php

Phlox [aux_row] Shortcode

The Auxin Elements shortcode ‘aux_row’ creates a responsive grid layout. It allows flexibility in column settings for different devices. The shortcode takes three attributes: ‘columns’, ‘tablet-columns’, and ‘mobile-columns’. If ‘tablet-columns’ is not specified, it defaults to half of the ‘columns’ value. The output is a div with classes corresponding to the specified column settings, allowing for responsive design.

Shortcode: [aux_row]

Parameters

Here is a list of all possible aux_row shortcode parameters and attributes:

  • columns – Determines the number of columns on a standard screen.
  • tablet-columns – Sets the number of columns on tablet devices.
  • mobile-columns – Specifies the number of columns on mobile devices.

Examples and Usage

Basic example – The shortcode ‘aux_row’ is used to create a row with a specified number of columns. By default, it creates a row with 3 columns.

[aux_row /]

Advanced examples

Creating a row with 4 columns:

[aux_row columns=4 /]

Creating a row with 4 columns on a desktop, 2 columns on a tablet, and 1 column on a mobile device:

[aux_row columns=4 tablet-columns=2 mobile-columns=1 /]

Creating a row with 2 columns on a desktop, but only 1 column on a tablet and mobile device:

[aux_row columns=2 tablet-columns=1 mobile-columns=1 /]

These examples demonstrate the flexibility of the ‘aux_row’ shortcode in creating responsive layouts. The ‘columns’, ‘tablet-columns’, and ‘mobile-columns’ attributes allow you to control the number of columns displayed on different devices, ensuring your content looks great on all screen sizes.

PHP Function Code

In case you have difficulties debugging what causing issues with [aux_row] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'aux_row', 'auxin_aux_row_shortcode' );

Shortcode PHP function:

function auxin_aux_row_shortcode( $atts , $content = null ) {

    if( empty( $atts['tablet-columns'] ) && ! empty( $atts['columns'] ) ){
        $atts['tablet-columns'] = ceil( (int)$atts['columns'] / 2 );
    }

    // parse attributes
    $parsed_atts = shortcode_atts(
        array(
            'columns'        => 3,
            'tablet-columns' => '',
            'mobile-columns' => 1
        ),
        $atts,
        'aux_row'
    );

    // collect custom layout css classes
    $classes = '';

    if( $parsed_atts['columns'] ){
        $classes .= esc_attr( 'aux-col' . $parsed_atts['columns'] ) . ' ';
    }
    if( $parsed_atts['tablet-columns'] ){
        $classes .= esc_attr( 'aux-tb-col' . $parsed_atts['tablet-columns'] ) . ' ';
    }
    if( $parsed_atts['mobile-columns'] ){
        $classes .= esc_attr( 'aux-mb-col' . $parsed_atts['mobile-columns'] ) . ' ';
    }

    // Return code
    return '<div class="aux-row '. trim( $classes ) .'">'. do_shortcode( $content ) .'</div>';
}

Code file location:

auxin-elements/auxin-elements/includes/general-shortcodes.php

Phlox [aux_col] Shortcode

The Auxin Elements plugin shortcode, ‘aux_col’, is designed to create a column in your WordPress layout. It wraps the content within a div class, ‘aux-col’, enabling you to style it separately.

Shortcode: [aux_col]

Examples and Usage

Basic example – A straightforward usage of the ‘aux_col’ shortcode to wrap content within a div container with the class ‘aux-col’.

[aux_col]Your content goes here[/aux_col]

PHP Function Code

In case you have difficulties debugging what causing issues with [aux_col] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'aux_col', 'auxin_aux_col_shortcode' );

Shortcode PHP function:

function auxin_aux_col_shortcode( $atts , $content = null ) {
    // Return code
    return '<div class="aux-col">'. do_shortcode( $content ) .'</div>';
}

Code file location:

auxin-elements/auxin-elements/includes/general-shortcodes.php

Conclusion

Now that you’ve learned how to embed the Shortcodes and extra features for Phlox theme Plugin shortcodes, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *