Unifies photo and testimony funcions in one shortcode

parent 68f6cbfa
......@@ -15,8 +15,13 @@ Domain Path: /lang/
// TODO: to include in plugin config page in dashboard
include('flickr.config.php');
// CSV data file vars
//
add_action( 'wp_head', 'turismomal_enqueue_styles' );
function turismomal_enqueue_styles() {
echo '<link href="/fontawesome/css/all.css" rel="stylesheet">';
}
// CSV data file vars
$csv = array(
'filename' => plugins_url() .'/'. plugin_basename( dirname( __FILE__ ) ) . '/content/testimonies.csv',
'line_length' => "1024", // max line lengh (increase in case you have longer lines than 1024 characters)
......@@ -73,20 +78,22 @@ function turismomal_get_testimony() {
// SHORTCODE
//
add_shortcode('muestra_testimonio', 'turismomal_testimony_shortcode');
add_shortcode('muestra_imagen', 'turismomal_image_shortcode');
function turismomal_image_shortcode($atts) {
$photo = turismomal_get_photoset_photo();
echo $photo;
}
function turismomal_testimony_shortcode($atts) {
// global $parameters;
// extract( shortcode_atts( $parameters, $atts ) );
if ( is_admin() )
return;
$photo = turismomal_get_photoset_photo();
$testimony = turismomal_get_testimony();
echo $testimony;
echo '<div class="tmal-wrapper">
<div class="tmal-hash">#elmalturismo</div>
<a class="tmal-btn" href="/"><i class="fas fa-redo"></i> Quiero más</a>
<div class="tmal-photo">'.$photo.'</div>
<div class="tmal-testimony"><i class="fas fa-quote-left"></i> '.$testimony.' <i class="fas fa-quote-right"></i></div>
</div>';
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment