-
Search Results
-
Topic: Countdown language
Most popular question)) How to change lenguage? As you can see i changed lines in file countdown php
Maybe something wrong?<?php
/**
* Animated Countdown
*
* Display Numbers that count from 0 to a specific date
*/
if ( ! defined( ‘ABSPATH’ ) ) { exit; } // Exit if accessed directlyif ( !class_exists( ‘avia_sc_countdown’ ) )
{class avia_sc_countdown extends aviaShortcodeTemplate
{
/**
* Create the config array for the shortcode button
*/
function shortcode_insert_button()
{
$this->config[‘self_closing’] = ‘yes’;$this->config[‘name’] = __(‘Animated Countdown’, ‘avia_framework’ );
$this->config[‘tab’] = __(‘Content Elements’, ‘avia_framework’ );
$this->config[‘icon’] = AviaBuilder::$path[‘imagesURL’].”sc-countdown.png”;
$this->config[‘order’] = 14;
$this->config[‘target’] = ‘avia-target-insert’;
$this->config[‘shortcode’] = ‘av_countdown’;
$this->config[‘tooltip’] = __(‘Display a countdown to a specific date’, ‘avia_framework’ );
$this->config[‘preview’] = “xlarge”;
$this->time_array = array(
__(‘Секунда’, ‘avia_framework’ ) =>’1′,
__(‘Минута’, ‘avia_framework’ ) =>’2′,
__(‘Час’, ‘avia_framework’ ) =>’3′,
__(‘День’, ‘avia_framework’ ) =>’4′,
__(‘Неделя’, ‘avia_framework’ ) =>’5′,
/*
__(‘Месяц’, ‘avia_framework’ ) =>’6′,
__(‘Год’, ‘avia_framework’ ) =>’7′
*/
);
}function extra_assets()
{
//load css
wp_enqueue_style( ‘avia-module-countdown’ , AviaBuilder::$path[‘pluginUrlRoot’].’avia-shortcodes/countdown/countdown.css’ , array(‘avia-layout’), false );//load js
wp_enqueue_script( ‘avia-module-countdown’ , AviaBuilder::$path[‘pluginUrlRoot’].’avia-shortcodes/countdown/countdown.js’ , array(‘avia-shortcodes’), false, TRUE );
}/**
* Popup Elements
*
* If this function is defined in a child class the element automatically gets an edit button, that, when pressed
* opens a modal window that allows to edit the element properties
*
* @return void
*/
function popup_elements()
{
$this->elements = array(
array(
“type” => “tab_container”, ‘nodescription’ => true
),array(
“type” => “tab”,
“name” => __(“Content” , ‘avia_framework’),
‘nodescription’ => true
),array(
“name” => __(“Date”,’avia_framework’ ),
“desc” => __(“Pick a date in the future.”,’avia_framework’ ),
“id” => “date”,
“type” => “datepicker”,
“container_class” => ‘av_third av_third_first’,
“std” => “”),array(
“name” => __(“Hour”, ‘avia_framework’ ),
“desc” => __(“Pick the hour of the day”, ‘avia_framework’ ),
“id” => “hour”,
“type” => “select”,
“std” => “12”,
“container_class” => ‘av_third’,
“subtype” => AviaHtmlHelper::number_array(0,23,1,array(),’ h’)),array(
“name” => __(“Minute”, ‘avia_framework’ ),
“desc” => __(“Pick the minute of the hour”, ‘avia_framework’ ),
“id” => “minute”,
“type” => “select”,
“std” => “0”,
“container_class” => ‘av_third’,
“subtype” => AviaHtmlHelper::number_array(0,59,1,array(),’ min’)),array(
“name” => __(“Smallest time unit”, ‘avia_framework’ ),
“desc” => __(“The smallest unit that will be displayed”, ‘avia_framework’ ),
“id” => “min”,
“type” => “select”,
“std” => “1”,
“subtype” => $this->time_array),array(
“name” => __(“Largest time unit”, ‘avia_framework’ ),
“desc” => __(“The largest unit that will be displayed”, ‘avia_framework’ ),
“id” => “max”,
“type” => “select”,
“std” => “5”,
“subtype” => $this->time_array),array(
“name” => __(“Text Alignment”, ‘avia_framework’ ),
“desc” => __(“Choose here, how to align your text”, ‘avia_framework’ ),
“id” => “align”,
“type” => “select”,
“std” => “center”,
“subtype” => array(
__(‘Center’, ‘avia_framework’ ) =>’av-align-center’,
__(‘Right’, ‘avia_framework’ ) =>’av-align-right’,
__(‘Left’, ‘avia_framework’ ) =>’av-align-left’,
)
),array( “name” => __(“Number Font Size”, ‘avia_framework’ ),
“desc” => __(“Size of your numbers in Pixel”, ‘avia_framework’ ),
“id” => “size”,
“type” => “select”,
“subtype” => AviaHtmlHelper::number_array(20,90,1, array( __(“Default Size”, ‘avia_framework’ )=>”)),
“std” => “”),array(
“type” => “close_div”,
‘nodescription’ => true
),array(
“type” => “tab”,
“name” => __(“Colors”,’avia_framework’ ),
‘nodescription’ => true
),array(
“name” => __(“Colors”, ‘avia_framework’ ),
“desc” => __(“Choose the colors here”, ‘avia_framework’ ),
“id” => “style”,
“type” => “select”,
“std” => “center”,
“subtype” => array(
__(‘Default’, ‘avia_framework’ ) =>’av-default-style’,
__(‘Theme colors’, ‘avia_framework’ ) =>’av-colored-style’,
__(‘Transparent Light’, ‘avia_framework’ ) =>’av-trans-light-style’,
__(‘Transparent Dark’, ‘avia_framework’ ) =>’av-trans-dark-style’,
)
),
array(
“type” => “close_div”,
‘nodescription’ => true
),array(
“type” => “tab”,
“name” => __(“Screen Options”,’avia_framework’ ),
‘nodescription’ => true
),array(
“name” => __(“Element Visibility”,’avia_framework’ ),
“desc” => __(“Set the visibility for this element, based on the device screensize.”, ‘avia_framework’ ),
“type” => “heading”,
“description_class” => “av-builder-note av-neutral”,
),array(
“desc” => __(“Hide on large screens (wider than 990px – eg: Desktop)”, ‘avia_framework’),
“id” => “av-desktop-hide”,
“std” => “”,
“container_class” => ‘av-multi-checkbox’,
“type” => “checkbox”),array(
“desc” => __(“Hide on medium sized screens (between 768px and 989px – eg: Tablet Landscape)”, ‘avia_framework’),
“id” => “av-medium-hide”,
“std” => “”,
“container_class” => ‘av-multi-checkbox’,
“type” => “checkbox”),array(
“desc” => __(“Hide on small screens (between 480px and 767px – eg: Tablet Portrait)”, ‘avia_framework’),
“id” => “av-small-hide”,
“std” => “”,
“container_class” => ‘av-multi-checkbox’,
“type” => “checkbox”),array(
“desc” => __(“Hide on very small screens (smaller than 479px – eg: Smartphone Portrait)”, ‘avia_framework’),
“id” => “av-mini-hide”,
“std” => “”,
“container_class” => ‘av-multi-checkbox’,
“type” => “checkbox”),array(
“type” => “close_div”,
‘nodescription’ => true
),array(
“name” => __(“Number Font Size”,’avia_framework’ ),
“desc” => __(“Set the font size for the number, based on the device screensize.”, ‘avia_framework’ ),
“type” => “heading”,
“description_class” => “av-builder-note av-neutral”,
),array( “name” => __(“Font Size for medium sized screens (between 768px and 989px – eg: Tablet Landscape)”, ‘avia_framework’ ),
“id” => “av-medium-font-size-title”,
“type” => “select”,
“subtype” => AviaHtmlHelper::number_array(10,60,1, array( __(“Default”, ‘avia_framework’ )=>” , __(“Hidden”, ‘avia_framework’ )=>’hidden’ ), “px”),
“std” => “”),array( “name” => __(“Font Size for small screens (between 480px and 767px – eg: Tablet Portrait)”, ‘avia_framework’ ),
“id” => “av-small-font-size-title”,
“type” => “select”,
“subtype” => AviaHtmlHelper::number_array(10,60,1, array( __(“Default”, ‘avia_framework’ )=>”, __(“Hidden”, ‘avia_framework’ )=>’hidden’), “px”),
“std” => “”),array( “name” => __(“Font Size for very small screens (smaller than 479px – eg: Smartphone Portrait)”, ‘avia_framework’ ),
“id” => “av-mini-font-size-title”,
“type” => “select”,
“subtype” => AviaHtmlHelper::number_array(10,60,1, array( __(“Default”, ‘avia_framework’ )=>”, __(“Hidden”, ‘avia_framework’ )=>’hidden’), “px”),
“std” => “”),array(
“name” => __(“Text Font Size”,’avia_framework’ ),
“desc” => __(“Set the font size for the text, based on the device screensize.”, ‘avia_framework’ ),
“type” => “heading”,
“description_class” => “av-builder-note av-neutral”,
),array( “name” => __(“Font Size for medium sized screens (between 768px and 989px – eg: Tablet Landscape)”, ‘avia_framework’ ),
“id” => “av-medium-font-size”,
“type” => “select”,
“subtype” => AviaHtmlHelper::number_array(10,60,1, array( __(“Default”, ‘avia_framework’ )=>”, __(“Hidden”, ‘avia_framework’ )=>’hidden’), “px”),
“std” => “”),array( “name” => __(“Font Size for small screens (between 480px and 767px – eg: Tablet Portrait)”, ‘avia_framework’ ),
“id” => “av-small-font-size”,
“type” => “select”,
“subtype” => AviaHtmlHelper::number_array(10,60,1, array( __(“Default”, ‘avia_framework’ )=>”, __(“Hidden”, ‘avia_framework’ )=>’hidden’), “px”),
“std” => “”),array( “name” => __(“Font Size for very small screens (smaller than 479px – eg: Smartphone Portrait)”, ‘avia_framework’ ),
“id” => “av-mini-font-size”,
“type” => “select”,
“subtype” => AviaHtmlHelper::number_array(10,60,1, array( __(“Default”, ‘avia_framework’ )=>”, __(“Hidden”, ‘avia_framework’ )=>’hidden’), “px”),
“std” => “”),array(
“type” => “close_div”,
‘nodescription’ => true
),
);}
/**
* Frontend Shortcode Handler
*
* @param array $atts array of attributes
* @param string $content text within enclosing form of shortcode element
* @param string $shortcodename the shortcode found, when == callback name
* @return string $output returns the modified html string
*/
function shortcode_handler($atts, $content = “”, $shortcodename = “”, $meta = “”)
{
extract(AviaHelper::av_mobile_sizes($atts)); //return $av_font_classes, $av_title_font_classes and $av_display_classes
extract(shortcode_atts(array( ‘date’ => ”,
‘hour’ => ’12’,
‘minute’ => ‘0’,
‘min’ => ‘1’,
‘max’ => ‘5’,
‘align’ => ‘center’,
‘size’ => ”,
‘style’ => ‘av-default-style’,
‘link’ => ”,
‘title’ => ”
)
, $atts));$this->full_time_array = array(
1 => array(“interval” => 1000 , ‘class’=>’seconds’, ‘label’ => __(‘Секунда’, ‘avia_framework’ ), ‘label_multi’ => __(‘Секунды’, ‘avia_framework’)),
2 => array(“interval” => 60000 , ‘class’=>’minutes’, ‘label’ => __(‘Минута’, ‘avia_framework’ ), ‘label_multi’ => __(‘Минуты’, ‘avia_framework’)),
3 => array(“interval” => 3600000 , ‘class’=>’hours’, ‘label’ => __(‘Час’, ‘avia_framework’), ‘label_multi’ => __(‘Часы’, ‘avia_framework’)),
4 => array(“interval” => 86400000 , ‘class’=>’days’, ‘label’ => __(‘День’, ‘avia_framework’ ), ‘label_multi’ => __(‘Дней’, ‘avia_framework’)),
5 => array(“interval” => 604800000 , ‘class’=>’weeks’, ‘label’ => __(‘Неделя’, ‘avia_framework’ ), ‘label_multi’ => __(‘Недель’, ‘avia_framework’)),
6 => array(“interval” => 2678400000 , ‘class’=>’months’, ‘label’ => __(‘Месяц’, ‘avia_framework’ ), ‘label_multi’ => __(‘Месяцев’, ‘avia_framework’)),
7 => array(“interval” => 31536000000 , ‘class’=>’years’, ‘label’ => __(‘Год’, ‘avia_framework’ ), ‘label_multi’ => __(‘Лет’, ‘avia_framework’)));
$interval = $this->full_time_array[$min][‘interval’];
$final_time = “”;
$output = “”;
$digit_style= “”;
$el = isset($meta[‘el_class’]) ? $meta[‘el_class’] : “”;if(!empty($date))
{
$date = explode(“/”, $date);$final_time .= ” data-year='”.$date[2].”‘”;
$final_time .= ” data-month='”.((int) $date[0] – 1).”‘”;
$final_time .= ” data-day='”.$date[1].”‘”;
$final_time .= ” data-hour='”.$hour.”‘”;
$final_time .= ” data-minute='”.$minute.”‘”;if(!empty($size)) $digit_style = “font-size:{$size}px; “;
$tags = !empty($link) ? array( “a href='{$link}’ “, “a”) : array(‘span’, ‘span’);$output .= “<div class=’av-countdown-timer {$av_display_classes} {$align} {$style} {$el}’ {$final_time} data-interval='{$interval}’ data-maximum='{$max}’ >”;
if( is_array( $title ) && isset( $title[‘top’] ) )
{
$output .= “<h3><{$tags[0]} class=’av-countdown-timer-title av-countdown-timer-title-top’>”.$title[‘top’].”</{$tags[1]}></h3>”;
}$output .= “<{$tags[0]} class=’av-countdown-timer-inner’>”;
foreach(array_reverse($this->time_array) as $key => $number)
{
if($number >= $min && $number <= $max)
{
$class = $this->full_time_array[$number][‘class’];
$single = $this->full_time_array[$number][‘label’];
$multi = $this->full_time_array[$number][‘label_multi’];$output .= “<span class=’av-countdown-cell av-countdown-“. $class .”‘>”;
$output .= “<span class=’av-countdown-cell-inner’>”;$output .= “<span class=’av-countdown-time {$av_title_font_classes}’ data-upate-width='{$class}’ style='{$digit_style}’>0</span>”;
$output .= “<span class=’av-countdown-time-label {$av_font_classes}’ data-label='{$single}’ data-label-multi='{$multi}’>”.$multi.”</span>”;$output .= “</span>”;
$output .= “</span>”;
}
}$output .= “</{$tags[1]}>”;
if( is_array( $title ) && isset( $title[‘bottom’] ) )
{
$output .= “<h3><{$tags[0]} class=’av-countdown-timer-title av-countdown-timer-title-bottom’>”.$title[‘bottom’].”</{$tags[1]}></h3>”;
}$output .= “</div>”;
}return $output;
}
}
}I am wanting “Comment 0 /” not to show when there is 0 comments. I want it blank.
I tried removing the checkmark from “check to display” Blog Post Comment Count in Blog Layout – Enfold Child Theme Options
but that did not stop the display of the Blog Post Comment Count when displayed in Grid Block FormatHere is a screenshot from my site http://screenshot.co/#!/da672a23a5 and I have circled in red the area I want to be made invisible
I have the postslider.php setup in the Child Theme per another posts instructions, and that is working.
I believe here is the code that I need to modify, but I don’t know how to modify it.Starting from line 604
if($show_meta && !empty($excerpt))
{
$meta = “<div class=’slide-meta’>”;
if ( $commentCount != “0” || comments_open($the_id) && $entry->post_type != ‘portfolio’)
{
$link_add = $commentCount === “0” ? “#respond” : “#comments”;
$text_add = $commentCount === “1” ? __(‘Comment’, ‘avia_framework’ ) : __(‘Comments’, ‘avia_framework’ );$meta .= “<div class=’slide-meta-comments’>{$commentCount} {$text_add}</div><div class=’slide-meta-del’>/</div>”;
}
$markup = avia_markup_helper(array(‘context’ => ‘entry_time’,’echo’=>false, ‘id’=>$the_id, ‘custom_markup’=>$custom_markup));
$meta .= “<time class=’slide-meta-time updated’ $markup>” .get_the_time(get_option(‘date_format’), $the_id).”</time>”;
$meta .= “</div>”;if( strpos($blogstyle, ‘elegant-blog’) === false )
{
$output .= $meta;
$meta = “”;
}
}there is in case of heaving that little round author image on blog listings a backlink to author infos. :
the infos except the biografie are not alway correct – because portfolio postings of those authers are not in the counter.
if i have that backlink the infos have to be correct. So on non mobile devices i set the pointer-event to none. – But on ipad etc the click function still gets active.
$blog_meta_output = "<a href='{$link}' class='post-author-format-type'><span class='rounded-container'>".$gravatar.$icon."</span></a>";or is it possible to get here only the link to the concerning post ( like on featured images)
I’ve got a custom element in the Avia Layout Builder that I’m needing to add link text to.
Meaning that every time a link is added, I’d like “Know More” text to display under the description.
Can anyone give me a hand?
Thanks!!
The current code for the custom block is:<?php /** * Slider * Shortcode that allows to slide some content */ if (!class_exists('avia_sc_offerings_blocks')) { class avia_sc_offerings_blocks extends aviaShortcodeTemplate { /** * Create the config array for the shortcode button */ function shortcode_insert_button() { $this->config['name'] = __('Offerings Block', 'avia_framework'); $this->config['tab'] = __('Custom Blocks', 'avia_framework'); $this->config['icon'] = AviaBuilder::$path['imagesURL'] . "sc-contentslider.png"; $this->config['order'] = 83; $this->config['target'] = 'avia-target-insert'; $this->config['shortcode'] = 'av_offerings_block'; $this->config['shortcode_nested'] = array('avia_offerings_block'); $this->config['tooltip'] = __('Display a content slider element', 'avia_framework'); } /** * Popup Elements * * If this function is defined in a child class the element automatically gets an edit button, that, when pressed * opens a modal window that allows to edit the element properties * * @return void */ function popup_elements() { $this->elements = array( array( "type" => "tab_container", 'nodescription' => true ), array( "type" => "tab", "name" => __("Content", 'avia_framework'), 'nodescription' => true ), array( "name" => __("Add/Edit Blocks", 'avia_framework'), "desc" => __("Here you can add, remove and edit the blocks you want to display.", 'avia_framework'), "type" => "modal_group", "id" => "content", "modal_title" => __("Edit Form Element", 'avia_framework'), "std" => array( array('title' => __('Block 1', 'avia_framework'), 'tags' => '') ), 'subelements' => array( array( "name" => __("Block Title", 'avia_framework'), "desc" => __("Enter the block title here (Better keep it short)", 'avia_framework'), "id" => "title", "std" => "Block Title", "type" => "input"), array( "name" => __("Title Link?", 'avia_framework'), "desc" => __("Where should your title link to?", 'avia_framework'), "id" => "link", "type" => "linkpicker", "fetchTMPL" => true, "std" => "", "subtype" => array( __('No Link', 'avia_framework') => '', __('Set Manually', 'avia_framework') => 'manually', __('Single Entry', 'avia_framework') => 'single', __('Taxonomy Overview Page', 'avia_framework') => 'taxonomy', ), "std" => ""), array( "name" => __("Open in new window", 'avia_framework'), "desc" => __("Do you want to open the link in a new window", 'avia_framework'), "id" => "linktarget", "required" => array('link', 'not', ''), "type" => "select", "std" => "", "subtype" => AviaHtmlHelper::linking_options()), array( "name" => __("Description",'avia_framework' ), "desc" => __("Enter description",'avia_framework' ), "id" => "content", "type" => "textarea", "std" => "" ), array( "name" => __("Choose Image", 'avia_framework'), "desc" => __("Either upload a new, or choose an existing image from your media library", 'avia_framework'), "id" => "src", "type" => "image", "title" => __("Insert Image", 'avia_framework'), "button" => __("Insert", 'avia_framework'), "std" => AviaBuilder::$path['imagesURL'] . "placeholder.jpg"), ) ), array( "name" => __("Heading", 'avia_framework'), "desc" => __("Do you want to display a heading above the images?", 'avia_framework'), "id" => "heading", "type" => "input", "std" => "", ), array( "name" => __("CSS ID", 'avia_framework'), "desc" => __("Custom ID for the block container", 'avia_framework'), "id" => "css_id", "type" => "input", "std" => "", ), array( "name" => __("CSS Class", 'avia_framework'), "desc" => __("Custom Class for the block container", 'avia_framework'), "id" => "css_class", "type" => "input", "std" => "", ), array( "type" => "close_div", 'nodescription' => true ), array( "type" => "tab", "name" => __("Colors", 'avia_framework'), 'nodescription' => true ), array( "name" => __("Font Colors", 'avia_framework'), "desc" => __("Either use the themes default colors or apply some custom ones", 'avia_framework'), "id" => "font_color", "type" => "select", "std" => "", "subtype" => array(__('Default', 'avia_framework') => '', __('Define Custom Colors', 'avia_framework') => 'custom'), ), array( "name" => __("Custom Font Color", 'avia_framework'), "desc" => __("Select a custom font color. Leave empty to use the default", 'avia_framework'), "id" => "color", "type" => "colorpicker", "std" => "", "container_class" => 'av_half av_half_first', "required" => array('font_color', 'equals', 'custom') ), array( "type" => "close_div", 'nodescription' => true ), array( "type" => "close_div", 'nodescription' => true ), ); } /** * Editor Element - this function defines the visual appearance of an element on the AviaBuilder Canvas * Most common usage is to define some markup in the $params['innerHtml'] which is then inserted into the drag and drop container * Less often used: $params['data'] to add data attributes, $params['class'] to modify the className * * * @param array $params this array holds the default values for $content and $args. * @return $params the return array usually holds an innerHtml key that holds item specific markup. */ function editor_element($params) { $heading = ""; $template = $this->update_template("heading", " - <strong>{{heading}}</strong>"); if (!empty($params['args']['heading'])) $heading = "- <strong>" . $params['args']['heading'] . "</strong>"; $params['innerHtml'] = "<img src='" . $this->config['icon'] . "' title='" . $this->config['name'] . "' />"; $params['innerHtml'].= "<div class='avia-element-label'>" . $this->config['name'] . "</div>"; $params['innerHtml'].= "<div class='avia-element-label' {$template}>" . $heading . "</div>"; return $params; } /** * Editor Sub Element - this function defines the visual appearance of an element that is displayed within a modal window and on click opens its own modal window * Works in the same way as Editor Element * @param array $params this array holds the default values for $content and $args. * @return $params the return array usually holds an innerHtml key that holds item specific markup. */ function editor_sub_element($params) { $template = $this->update_template("title", "{{title}}"); $params['innerHtml'] = ""; $params['innerHtml'] .= "<div class='avia_title_container' {$template}>" . $params['args']['title'] . "</div>"; return $params; } /** * Frontend Shortcode Handler * * @param array $atts array of attributes * @param string $content text within enclosing form of shortcode element * @param string $shortcodename the shortcode found, when == callback name * @return string $output returns the modified html string */ function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "") { $atts = shortcode_atts(array( 'type' => 'slider', 'autoplay' => 'false', 'animation' => 'fade', 'interval' => 5, 'navigation' => 'arrows', 'heading' => '', 'columns' => 3, "css_id" => "", "css_class" => "", 'handle' => $shortcodename, 'content' => ShortcodeHelper::shortcode2array($content, 1), 'class' => $meta['el_class'], 'custom_markup' => $meta['custom_markup'], 'font_color' => '', 'color' => '', 'styling' => '' ), $atts, $this->config['shortcode']); if ($atts['font_color'] == "custom") { $atts['class'] .= " av_inherit_color"; $atts['styling'] .=!empty($atts['color']) ? " color:" . $atts['color'] . "; " : ""; if ($atts['styling']) $atts['styling'] = " style='" . $atts['styling'] . "'"; } $slider = new avia_offerings_block($atts); return $slider->html(); } } } if (!class_exists('avia_offerings_block')) { class avia_offerings_block { static $slider = 0; //slider count for the current page protected $config; //base config set on initialization function __construct($config) { global $avia_config; $output = ""; $this->config = array_merge(array( 'type' => 'grid', 'autoplay' => 'false', 'animation' => 'fade', 'handle' => '', 'heading' => '', 'navigation' => 'arrows', 'columns' => 3, 'interval' => 5, 'class' => "", 'custom_markup' => "", 'css_id' => "", 'css_class' => "", 'content' => array(), 'styling' => "" ), $config); } public function html() { $output = ""; $counter = 0; avia_offerings_block::$slider++; if (empty($this->config['content'])) return $output; //$html .= empty($this->subslides) ? $this->default_slide() : $this->advanced_slide(); extract($this->config); $columns = 3; $extraClass = 'first'; $slide_loop_count = 1; $loop_counter = 1; $total = $columns % 2 ? "odd" : "even"; $heading = !empty($this->config['heading']) ? '<h2>' . $this->config['heading'] . '</h2>' : " "; $slide_count = count($content); $grid = 'av_one_fifth'; $data = AviaHelper::create_data_string(array('autoplay' => $autoplay, 'interval' => $interval, 'animation' => $animation, 'show_slide_delay' => 30)); $id = 'id="'.$css_id.'"'; $thumb_fallback = ""; $output .= "<div {$id} class='{$css_class} col-centered offerings custom-block' {$styling}>"; $heading_class = ''; if ($navigation == 'no') $heading_class .= ' no-content-slider-navigation '; if ($heading == ' ') $heading_class .= ' no-content-slider-heading '; $output .= "<div class='avia-smallarrow-slider-heading $heading_class'>"; $output .= "<div class='new-special-heading'>" . $heading . "</div>"; $output .= "</div>"; $output .= "<div class='avia-content-slider-inner'>"; foreach ($content as $key => $value) { $link = $linktarget = ""; extract($value['attr']); $link = aviaHelper::get_url($link); $blank = (strpos($linktarget, '_blank') !== false || $linktarget == 'yes') ? ' target="_blank" ' : ""; $blank .= strpos($linktarget, 'nofollow') !== false ? ' rel="nofollow" ' : ""; $parity = $loop_counter % 2 ? 'odd' : 'even'; $last = $slide_count == $slide_loop_count ? " post-entry-last " : ""; $post_class = "post-entry slide-entry-overview slide-loop-{$slide_loop_count} slide-parity-{$parity} {$last}"; if ($loop_counter == 1) $output .= "<div class='block-entry-wrap col-centered'>"; $markup = avia_markup_helper(array('context' => 'entry', 'echo' => false, 'custom_markup' => $custom_markup)); $output .= "<section class='flex_column av_one_third col-centered {$post_class} {$grid} {$extraClass}' $markup>"; $markup = avia_markup_helper(array('context' => 'entry_title', 'echo' => false, 'custom_markup' => $custom_markup)); if(!empty($src)){ $img = "<img src='".$src."' alt='" . esc_attr($title) . "' />"; } else { $img = "<img src='".AviaBuilder::$path['imagesURL'] . "placeholder.jpg"."' alt='" . esc_attr($title) . "' />"; } if(!empty($link)){ $output .= "<a href='{$link}' $blank title='" . esc_attr($title) . "'>"."<div class='avia_image_container'>{$img}</div>"."</a>"; } else { $output .= "<div class='avia_image_container'>{$img}</div>"; } $output .=!empty($title) ? "<h3 class='slide-entry-title entry-title' $markup>" : ''; $output .= (!empty($link) && !empty($title)) ? "<a href='{$link}' $blank title='" . esc_attr($title) . "'>" . $title . "</a>" : $title; $output .=!empty($title) ? '</h3>' : ''; $markup = avia_markup_helper(array('context' => 'entry_content', 'echo' => false, 'custom_markup' => $custom_markup)); $output .=!empty($value['content']) ? "<div class='slide-entry-excerpt entry-content' $markup>" . ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop($value['content'])) . "</div>" : ""; $output .= '</section>'; $loop_counter ++; $slide_loop_count ++; $extraClass = ""; if ($loop_counter > $columns) { $loop_counter = 1; $extraClass = 'first'; } if ($loop_counter == 1 || !empty($last)) { $output .="</div>"; } } $output .= "</div>"; $output .= "</div>"; return $output; } } }Thanks!
Hi,
I’ve introduced a custom field to show an overline / deck head above a post’s heading (variable name $dachzeile) instead of the category name.
Works fine on the post page itself – I managed to add this code snippet to loop-index.php:$dachzeile = get_post_meta($post->ID, 'dachzeile', true); if($dachzeile != '') { echo '<div class="dachzeile">' . $dachzeile . '</div>'; } else { echo '<div class="dachzeile">'; the_category(' / '); echo '</div>';}However, I struggle to modify postslider.php in the correct way.
Tried to modify the line with h3 like this …$output .= "<div class='dachzeile_startseite'>".$dachzeile."</div><h3 class='slide-entry-title entry-title' $markup><a href='{$link}' title='".esc_attr(strip_tags($title))."'>".$title."</a></h3>";… (fallback option from above not implemented yet), but the value of the custom field does not appear.
- What is missing to make the custom field data loading (getting it into the loop, registering support for custom fields within a custom post type in supports $args etc.)?
- How does the correct code with fallback option (“use category name if $dachzeile is empty”) look like?
Thanks!
