This topic has 8 replies, 3 voices, and was last updated 8 years, 11 months ago by Fem.
Tagged: shortcodes buttons syntax
Viewing 9 posts - 1 through 9 (of 9 total)
I’m a little confused why I can’t seem to find any examples of the shortcodes or shortcode options for your included Aivah shortcode insert. Is there a page anywhere with examples and details on the various codes included? It seems a little silly to have to make a test page with every shortcode to see what it does and figure out the classes that are utilized in the theme, when there should be a list of them somewhere for the theme.
You need to checkout the full list of the shortcodes we created on http://www.aivahthemes.com/wp/anona/shortcodes/ check this out and click on the sidebar list menu for the shortcodes.
Try replacing the below code in anona-core/anona-shortcodes/shortcode/testimonials.php file located in plugins directory
<?php
// Testimonials
//--------------------------------------------------------
if ( ! function_exists( 'iva_sc_tesimonials' ) ) {
function iva_sc_tesimonials( $atts, $content = null ) {
extract(shortcode_atts(array(
'style' => '',
'cat' => '',
'limit' => '-1',
'speed' => '',
'itemslimit' => '2',
'gridcolumns' => '2columns',
'pagination' => 'true',
'carousel_speed' => '3000',
), $atts));
global $post, $paged, $wp_query;
$rand = rand( 10,100 );
$testimonial_gravatar_image = $out = $before = $after = '';
if ( get_query_var( 'paged' ) ) {
$paged = get_query_var( 'paged' );
} elseif ( get_query_var( 'page' ) ) {
$paged = get_query_var( 'page' );
} else {
$paged = 1;
}
$testimonial_query = array(
'post_type' => 'testimonialtype',
'showposts' => $limit,
'tax_query' => array(
'relation' => 'OR',
),
'paged' => $paged,
);
if ( '' !== $cat ) {
$cats = explode( ',',$cat );
$tax_cat = array(
'taxonomy' => 'testimonial_cat',
'field' => 'slug',
'terms' => $cats,
);
array_push( $testimonial_query['tax_query'],$tax_cat );
}
//$original_query = $wp_query;
// Query executes here;
$testomonials_query = new WP_Query( $testimonial_query );
//$wp_query = $testomonials_query;
// Style 'carousel'
if ( 'carousel' === $style ) {
$jcarousel_id = rand( 10,99 );
//Enqueue Owl Carousel
wp_enqueue_style( 'anona-sc-owl-style' );
wp_enqueue_style( 'anona-sc-owl-theme' );
$out .= '<script>
jQuery(document).ready(function($) {
$("#owl-' . $jcarousel_id . '").owlCarousel({
autoPlay: ' . $carousel_speed . ', //Set AutoPlay to 3 seconds
items : ' . $itemslimit . ',
itemsDesktop : [1199,1],
itemsDesktopSmall : [1024,1],
itemsTablet : [768,1],
itemsMobile : [479,1]
});
});
</script>';
$out .= '<div id="owl-' . $jcarousel_id . '" class="owl-carousel">';
}
// Style 'fade'
if ( 'fade_tm' === $style ) {
echo'<script type="text/javascript">
jQuery(document).ready(function() {
"use strict";
MySlider(' . $speed . ',"testimonial' . $rand . '");
});
</script>';
$out .= '<div id="testimonial' . $rand . '" class="testimonial_list"><ul class="testimonials">';
}
$count = $columns = '';
if ( 'grid' === $style ) {
$count = 0;
$columns = 2;
}
if ( $testomonials_query->have_posts() ) {
if ( 'list' === $style ) {
$out .= '<div class="testimonials-list">';
}
if ( 'grid' === $style ) {
$out .= '<div class="testimonial-grid-wrap">';
}
while ( $testomonials_query->have_posts() ) : $testomonials_query->the_post();
$tm_last_class = '';
$company_name = get_post_meta( get_the_ID(), 'company_name', true );
$website_name = get_post_meta( get_the_ID(), 'website_name', true );
$website_url = get_post_meta( get_the_ID(), 'website_url', true );
$testimonial_image_option = get_post_meta( get_the_ID(), 'testimonial_image_option',true );
$testimonial_content = get_the_content( get_the_ID() );
switch ( $testimonial_image_option ) {
case 'gravatar':
$testimonial_email = get_post_meta( get_the_ID(),'testimonial_email',true );
$testimonial_gravatar_image = get_avatar( $testimonial_email, 80 );
break;
case 'customimage':
$testimonial_image = get_post_meta( get_the_ID(),'testimonial_photo',true );
$testimonial_gravatar_image = iva_sc_resize( '', $testimonial_image,'80', '80', 'imageborder', '' );
break;
}
// Style 'carousel'
if ( 'carousel' === $style ) {
$out .= '<div class="testimonial-carousel">';
$out .= '<span class="tc-details">';
if ( '' !== $testimonial_gravatar_image ) {
$out .= '<span class="tc-client-image">' . $testimonial_gravatar_image . '</span>';
}
$out .= '</span>';
$out .= '<div class="tc-content"><p>' . $testimonial_content . '</p>';
if ( '' !== $website_url ) {
$before = ', <a href="' . esc_url( $website_url ) . '" target="_blank">';
$after = '</a>';
}
$clientname = ' - ' . get_the_title() . ', ' . $company_name;
$out .= '<div class="tc-client-meta"><div class="client-name">' . $clientname;
if ( '' !== $website_name ) {
$out .= $before . $website_name . $after;
}
$out .= '</div></div>';
$out .= '</div></div>';
}
// Style 'fade'
if ( 'fade_tm' === $style ) {
$out .= '<li>';
$out .= '<div class="testimonial-box">';
$out .= '<div class="tc-details">';
if ( '' !== $testimonial_gravatar_image ) {
$out .= '<div class="tc-client-image">' . $testimonial_gravatar_image . '</div>';
}
$out .= '</div>';
$out .= '<div class="tc-content"><p>' . $testimonial_content . '</p>';
if ( '' !== $website_url ) {
$before = ', <a href="' . esc_url( $website_url ) . '" target="_blank">';
$after = '</a>';
}
$clientname = '<strong>' . get_the_title() . '</strong>' . $company_name;
if ( '' !== $website_name ) {
$out .= '<div class="tc-client-meta"><div class="client-name">' . $clientname . $before . $website_name . $after . '</div></div>';
}
$out .= '</div></div>';
$out .= '</li>';
}
// Style 'list'
if ( 'list' === $style ) {
$out .= '<div class="testimonial-box">';
$out .= '<div class="tc-details">';
if ( '' !== $testimonial_gravatar_image ) {
$out .= '<div class="tc-client-image">' . $testimonial_gravatar_image . '</div>';
}
$out .= '</div>';
$out .= '<div class="tc-content"><p>' . $testimonial_content . '</p>';
if ( '' !== $website_url ) {
$before = ', <a href="' . esc_url( $website_url ) . '" target="_blank">';
$after = '</a>';
}
$clientname = '<strong>' . get_the_title() . '</strong>' . $company_name;
if ( '' !== $website_name ) {
$out .= '<div class="tc-client-meta"><div class="client-name">' . $clientname . $before . $website_name . $after . '</div></div>';
}
$out .= '</div>';
$out .= '</div>';
}
// Style 'grid'
if ( 'grid' === $style ) {
$count++;
if ( '2columns' === $gridcolumns ) {
$iva_grid_columns = 'iva_one_half';
if ( 1 === $count ) {
$out .= '<div class="testimonial-row">';
}
if ( 2 === $count ) {
$tm_last_class = 'iva-last-testimonial';
}
} else {
$iva_grid_columns = 'iva_one_third';
if ( 1 === $count ) {
$out .= '<div class="testimonial-row">';
}
if ( 3 === $count ) {
$tm_last_class = 'iva-last-testimonial';
}
}
$out .= '<div class="' . $iva_grid_columns . ' iva-testimonial ' . $tm_last_class . '">';
// Testimonial content
$out .= '<div class="testimonial-box">';
$out .= '<div class="tc-details">';
if ( '' !== $testimonial_gravatar_image ) {
$out .= '<div class="tc-client-image">' . $testimonial_gravatar_image . '</div>';
}
$out .= '</div>';
$out .= '<div class="tc-content"><p>' . $testimonial_content . '</p>';
if ( '' !== $website_url ) {
$before = ', <a href="' . esc_url( $website_url ) . '" target="_blank">';
$after = '</a>';
}
$clientname = '<strong>' . get_the_title() . '</strong>' . $company_name;
if ( '' !== $website_name ) {
$out .= '<div class="tc-client-meta"><div class="client-name">' . $clientname . $before . $website_name . $after . '</div></div>';
}
$out .= '</div>';
$out .= '</div>';
// Testimonial content ends here
$out .= '</div>';
if ( '2columns' === $gridcolumns ) {
if ( 2 === $count ) {
$out .= '</div>'; //.iva_one_half
$count = 0;
}
} else {
if ( 3 === $count ) {
$out .= '</div>'; //.iva_one_third
$count = 0;
}
}
} // End if().
endwhile;
// Style 'list'
if ( 'list' === $style ) {
$out .= '</div>';
if ( 'true' === $pagination ) {
if ( function_exists( 'iva_pagination' ) ) {
ob_start();
$out .= iva_pagination();
$out .= ob_get_contents();
ob_end_clean();
}
}
}
// Style 'fade'
if ( 'fade_tm' === $style ) {
$out .= '</ul></div>';
}
// Style 'carousel'
if ( 'carousel' === $style ) {
$out .= '</div>';
wp_enqueue_script( 'anona-sc-owl-carousel' );
}
// Style 'grid'
if ( 'grid' === $style ) {
$out .= '</div>';
}
wp_reset_postdata();
} // End if().
return $out;
}
//End Testimonials List Function
add_shortcode( 'testimonials','iva_sc_tesimonials' );
} // End if().
/**
* Testimonials
*
*/
/**
* Function for Adding Testimonials Component on vc_init hook
*
* @param void
*
* @return void
*/
if ( ! function_exists( 'anona_vc_testimonials' ) ) {
function anona_vc_testimonials() {
$iva_testimonials_cat = array();
$iva_testimonials_categories = get_terms( 'testimonial_cat', 'orderby=name&hide_empty= 0' );
if ( ! empty( $iva_testimonials_categories ) ) {
foreach ( $iva_testimonials_categories as $iva_testimonials_category ) {
$iva_testimonials_cat[ $iva_testimonials_category->slug ] = $iva_testimonials_category->name;
}
}
// Title
vc_map(
array(
'name' => esc_html__( 'Testimonials', 'aivah_shortcodes' ),
'base' => 'testimonials',
'category' => esc_html__( 'Anona', 'aivah_shortcodes' ),
'params' => array(
array(
'type' => 'dropdown',
'holder' => 'div',
'class' => '',
'heading' => esc_html__( 'Style', 'aivah_shortcodes' ),
'param_name' => 'style',
'value' => array(
esc_html__( 'Choose one..','aivah_shortcodes' ) => '',
'List' => 'list',
'Fade' => 'fade',
'Carousel' => 'carousel',
'Grid' => 'grid',
),
'description' => esc_html__( 'Choose the style of the Testimonial you wish to use.', 'aivah_shortcodes' ),
),
array(
'type' => 'dropdown',
'holder' => 'div',
'class' => '',
'heading' => esc_html__( 'Categories', 'aivah_shortcodes' ),
'param_name' => 'cat',
'value' => $iva_testimonials_cat,
'description' => esc_html__( 'Choose any Category from dropdown in which the selected categories will hold the posts to display.', 'aivah_shortcodes' ),
),
array(
'type' => 'textfield',
'holder' => 'div',
'class' => '',
'heading' => esc_html__( 'Limit' , 'aivah_shortcodes' ),
'param_name' => 'limit',
'value' => '',
'description' => esc_html__( 'Enter the limit you wish to display if multiple testimonials/category is selected.' , 'aivah_shortcodes' ),
),
array(
'type' => 'textfield',
'holder' => 'div',
'class' => '',
'heading' => esc_html__( 'Speed' , 'aivah_shortcodes' ),
'param_name' => 'speed',
'dependency' => array(
'element' => 'style',
'value' => array( 'fade', 'carousel' ),
),
'value' => '',
'description' => esc_html__( 'Speed of the Testimonials. ( Default Speed: 5000, for eg: 1000ms = 1sec )' , 'aivah_shortcodes' ),
),
array(
'type' => 'textfield',
'holder' => 'div',
'class' => '',
'heading' => esc_html__( 'Items Limit' , 'aivah_shortcodes' ),
'param_name' => 'itemslimit',
'dependency' => array(
'element' => 'style',
'value' => array( 'carousel' ),
),
'value' => '',
'description' => esc_html__( 'Number of Testimonials Items to display for Carousel.' , 'aivah_shortcodes' ),
),
array(
'type' => 'dropdown',
'holder' => 'div',
'class' => '',
'heading' => esc_html__( 'Grid Columns', 'aivah_shortcodes' ),
'param_name' => 'gridcolumns',
'dependency' => array(
'element' => 'style',
'value' => array( 'grid' ),
),
'value' => array(
esc_html__( 'Choose one..','aivah_shortcodes' ) => '',
'2 Columns' => '2columns',
'3 Columns' => '3columns',
),
'description' => esc_html__( 'Choose the no. of columns you wish to display for Testimonials.', 'aivah_shortcodes' ),
),
array(
'type' => 'checkbox',
'holder' => 'div',
'class' => '',
'heading' => esc_html__( 'Pagination', 'aivah_shortcodes' ),
'param_name' => 'pagination',
'value' => '',
'description' => esc_html__( 'Check this if you wish to enable the Pagination.', 'aivah_shortcodes' ),
),
array(
'type' => 'textfield',
'holder' => 'div',
'class' => '',
'heading' => esc_html__( 'Carousel Speed' , 'aivah_shortcodes' ),
'param_name' => 'carousel_speed',
'dependency' => array(
'element' => 'style',
'value' => array( 'carousel' ),
),
'value' => '',
'description' => esc_html__( 'Speed of the Testimonials. ( Default Speed: 5000, for eg: 1000ms = 1sec )' , 'aivah_shortcodes' ),
),
),
)
);
}
} // End if().
add_action( 'vc_before_init', 'anona_vc_testimonials' );
@itsonlycomputers – If you can provide us WP Logins to your website with URL then we can take a closer look at it. Make sure you set the post as a private reply so that only admin can see your wp-logins.
Note: Before providing the wp-login to any support staff, kindly please make sure you take a backup of everything including WordPress content, theme options, widgets etc.
Viewing 9 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic.