本文整理汇总了PHP中themerex_substr函数的典型用法代码示例。如果您正苦于以下问题:PHP themerex_substr函数的具体用法?PHP themerex_substr怎么用?PHP themerex_substr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了themerex_substr函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: widget
/**
* How to display the widget on the screen.
*/
function widget($args, $instance)
{
extract($args);
/* Our variables from the widget settings. */
$title = apply_filters('widget_title', isset($instance['title']) ? $instance['title'] : '');
$twitter_username = isset($instance['twitter_username']) ? $instance['twitter_username'] : '';
$twitter_consumer_key = isset($instance['twitter_consumer_key']) ? $instance['twitter_consumer_key'] : '';
$twitter_consumer_secret = isset($instance['twitter_consumer_secret']) ? $instance['twitter_consumer_secret'] : '';
$twitter_token_key = isset($instance['twitter_token_key']) ? $instance['twitter_token_key'] : '';
$twitter_token_secret = isset($instance['twitter_token_secret']) ? $instance['twitter_token_secret'] : '';
$twitter_count = isset($instance['twitter_count']) ? $instance['twitter_count'] : '';
if (empty($twitter_consumer_key) || empty($twitter_consumer_secret) || empty($twitter_token_key) || empty($twitter_token_secret)) {
return;
}
$data = getTwitterData(array('mode' => 'user_timeline', 'consumer_key' => $twitter_consumer_key, 'consumer_secret' => $twitter_consumer_secret, 'token' => $twitter_token_key, 'secret' => $twitter_token_secret));
if (!$data || !isset($data[0]['text'])) {
return;
}
$output = '<ul>';
$cnt = 0;
foreach ($data as $tweet) {
$tweet_date = $tweet['created_at'];
$date_diff = '<span class="tweet_date"><i class="icon-clock-1"></i>' . getDateOrDifference($tweet_date) . '</span>';
if (themerex_substr($tweet['text'], 0, 1) == '@') {
continue;
}
$output .= '<li class="theme_text' . ($cnt == $twitter_count - 1 ? ' last' : '') . '"><i class="icon-twitter"></i><a href="https://twitter.com/' . $twitter_username . '" class="username" target="_blank">@' . $tweet['user']['screen_name'] . '</a> ' . twitter_prepare_text($tweet) . $date_diff . '</li>';
if (++$cnt >= $twitter_count) {
break;
}
}
$output .= '</ul>';
if (!empty($output)) {
/* Before widget (defined by themes). */
echo $before_widget;
/* Display the widget title if one was input (before and after defined by themes). */
echo $before_title . $title . $after_title;
echo $output;
/* After widget (defined by themes). */
echo $after_widget;
}
}
示例2: themerex_enqueue_script
function themerex_enqueue_script($handle, $src = false, $depts = array(), $ver = null, $in_footer = false)
{
if (!is_array($src) && $src !== false && $src !== '') {
global $THEMEREX_DEBUG_MODE;
//if (empty($THEMEREX_DEBUG_MODE)) $THEMEREX_DEBUG_MODE = get_theme_option('debug_mode');
$THEMEREX_DEBUG_MODE = false;
$theme_dir = get_template_directory();
$theme_url = get_template_directory_uri();
$child_dir = get_stylesheet_directory();
$child_url = get_stylesheet_directory_uri();
$dir = $url = '';
if (themerex_strpos($src, $child_url) === 0) {
$dir = $child_dir;
$url = $child_url;
} else {
if (themerex_strpos($src, $theme_url) === 0) {
$dir = $theme_dir;
$url = $theme_url;
}
}
if ($dir != '') {
if ($THEMEREX_DEBUG_MODE == 'no') {
if (themerex_substr($src, -3) == '.js') {
if (themerex_substr($src, -7) != '.min.js') {
$src_min = themerex_substr($src, 0, themerex_strlen($src) - 3) . '.min.js';
$file_src = $dir . themerex_substr($src, themerex_strlen($url));
$file_min = $dir . themerex_substr($src_min, themerex_strlen($url));
if (file_exists($file_min) && filemtime($file_src) <= filemtime($file_min)) {
$src = $src_min;
}
}
}
}
}
}
if (is_array($src)) {
wp_enqueue_script($handle, $depts, $ver, $in_footer);
} else {
wp_enqueue_script($handle, $src, $depts, $ver, $in_footer);
}
}
示例3: strip_tags
<?php
}
?>
</header>
<?php
}
?>
<div class="entry_content">
<?php
if ($post_data['post_protected']) {
echo $post_data['post_excerpt'];
} else {
if ($post_data['post_excerpt']) {
if (in_array($post_data['post_format'], array('standard', 'gallery', 'video', 'audio', 'image'))) {
$post_excerpt = strip_tags(themerex_substr($post_data['post_excerpt'], 0, $excerpt_length));
} else {
$post_excerpt = $post_data['post_excerpt'];
}
?>
<div class="<?php
echo $post_data['post_format'];
?>
_text_wrap">
<?php
if (!in_array($post_data['post_format'], array('quote', 'image', 'chat', 'status', 'aside', 'link'))) {
echo $post_excerpt . ' <a href="' . $post_data['post_link'] . '">[...]</a>';
} else {
echo $post_excerpt;
}
?>
示例4: themerex_compose_styles
function themerex_compose_styles()
{
global $wp_styles, $concatenate_scripts, $compress_css, $THEMEREX_styles_collector;
if (is_admin() || get_theme_option('compose_scripts') != 'yes' || !is_object($wp_styles)) {
return;
}
//$concatenate_scripts = $compress_css = true;
$theme_url = get_template_directory_uri();
foreach ($wp_styles->queue as $style) {
if (isset($wp_styles->registered[$style]) && themerex_strpos($wp_styles->registered[$style]->src, $theme_url) === 0 && themerex_strpos($wp_styles->registered[$style]->ver, 'no-compose') === false) {
//$dir = dirname(themerex_substr($wp_styles->registered[$style]->src, themerex_strlen($wp_styles->base_url))).'/';
$dir = dirname($wp_styles->registered[$style]->src) . '/';
if (file_exists($file = get_template_directory() . themerex_substr($wp_styles->registered[$style]->src, themerex_strlen($theme_url)))) {
$css = file_get_contents($file);
if (isset($wp_styles->registered[$style]->extra['after'])) {
foreach ($wp_styles->registered[$style]->extra['after'] as $add) {
$css .= "\n" . $add . "\n";
}
}
$pos = -1;
while (($pos = themerex_strpos($css, 'url(', $pos + 1)) !== false) {
if (themerex_substr($css, $pos, 9) == 'url(data:') {
continue;
}
$shift = 0;
if (($ch = themerex_substr($css, $pos + 4, 1)) == '"' || $ch == "'") {
$shift = 1;
}
$css = themerex_substr($css, 0, $pos + 4 + $shift) . $dir . themerex_substr($css, $pos + 4 + $shift);
}
$THEMEREX_styles_collector .= "\n" . $css . "\n";
$wp_styles->done[] = $style;
}
}
}
if ($THEMEREX_styles_collector) {
echo "\n<!-- Stylesheets composer -->\n<style type=\"text/css\">\n" . $THEMEREX_styles_collector . "\n</style>\n<!-- /Stylesheets composer -->\n";
}
}
示例5: get_custom_option
<?php
$post_title_tag = 'h4';
$style = $opt['style'];
$border = $opt['border'];
/* Reviews */
$review_type = get_custom_option('reviews_first');
$review_avg = $post_data['post_reviews_' . $review_type];
$review_first = get_custom_option('reviews_first');
$review_max = get_custom_option('reviews_max_level');
$review_style = get_custom_option('reviews_style');
$review_color = get_custom_option('review_color');
$review = !empty($review_avg) ? get_review_rating('5stars', $review_avg, $review_max, '#f2c574') : '';
/* /Reviews */
$format_icon = getPostFormatIcon($post_data['post_format']);
$title = '<' . $post_title_tag . ' class="sc_blogger_title sc_title' . (in_array($opt['style'], array('accordion_1', 'accordion_2')) ? ' sc_accordion_title' : '') . '">' . '<a href="' . (in_array($opt['style'], array('accordion_1', 'accordion_2')) ? '#' : $post_data['post_link']) . '">' . (themerex_substr($opt['style'], 0, 6) == 'bubble' ? '<span class="sc_title_bubble_icon ' . ($post_data['post_icon'] != '' ? ' ' . $post_data['post_icon'] : '') . '"' . ($post_data['bubble_color'] != '' ? ' style="background-color:' . $post_data['bubble_color'] . '"' : '') . '></span>' : '') . $post_data['post_title'] . '</a>' . '</' . $post_title_tag . '>';
$info = '<header class="post_info infoPost">';
$info .= $title;
$info .= '<div class="subheader">';
$info .= $review;
$info .= '<span class="icon-clock-1"></span>' . $post_data['post_date'];
$info .= '<span class="separator">|</span>
<a class="icon-comment-1" title="' . sprintf(__('Comments - %s', 'themerex'), $post_data['post_comments']) . '" href="' . $post_data['post_comments_link'] . '">' . $post_data['post_comments'] . '</a>';
$info .= '</div>';
$info .= '</header>';
?>
<article class="sc_blogger_item<?php
echo (in_array($opt['style'], array('accordion_1', 'accordion_2')) ? ' sc_accordion_item' : '') . ($opt['number'] == $opt['found'] ? ' sc_blogger_item_last' : '') . (sc_param_is_on($opt['scroll']) && ($opt['dir'] == 'vertical' || $opt['style'] == 'date') ? ' sc_scroll_slide swiper-slide' : '') . ($border == "true" ? ' border' : '') . ($opt['number'] == $opt['found'] ? ' last' : '');
?>
">
示例6: decorateMoreLink
function decorateMoreLink($text, $tag_start = '<div class="readmore">', $tag_end = '</div>')
{
//return preg_replace('/(<a[^>]+class="more-link"[^>]*>[^<]*<\\/a>)/', "{$tag_start}\${1}{$tag_end}", $text);
$rez = $text;
if (($pos = themerex_strpos($text, ' class="more-link"><span class="readmore">')) !== false) {
$i = $pos - 1;
while ($i > 0) {
if (themerex_substr($text, $i, 3) == '<a ') {
if (($pos = themerex_strpos($text, '</span></a>', $pos)) !== false) {
$pos += 11;
$start = themerex_substr($text, $i - 4, 4) == '<p> ' ? $i - 4 : (themerex_substr($text, $i - 3, 3) == '<p>' ? $i - 3 : $i);
$end = themerex_substr($text, $pos, 4) == '</p>' ? $pos + 4 : $pos;
$rez = themerex_substr($text, 0, $start) . $tag_start . themerex_substr($text, $i, $pos - $i) . $tag_end . themerex_substr($text, $end);
break;
}
}
$i--;
}
}
return $rez;
}
示例7: get_custom_option
<div class="isotopeFiltr"></div>
<?php
}
?>
<section class="masonry grid portfolioNOspacing <?php
echo get_custom_option('show_filters') == 'yes' ? 'isotope' : 'isotopeNOanim';
?>
">
<?php
}
}
}
while (have_posts()) {
the_post();
$post_number++;
$post_args = array('layout' => in_array(themerex_substr($blog_style, 0, 7), array('classic', 'masonry', 'portfol')) ? themerex_substr($blog_style, 0, 7) : themerex_substr($blog_style, 0, 7), 'number' => $post_number, 'add_view_more' => false, 'posts_on_page' => $per_page, 'thumb_size' => $blog_style, 'thumb_crop' => themerex_strpos($blog_style, 'masonry') === false, 'strip_teaser' => false, 'parent_cat_id' => $parent_cat_id, 'sidebar' => !in_array($show_sidebar_main, array('none', 'fullwidth')), 'filters' => get_custom_option('show_filters') == 'yes' ? get_custom_option('filter_taxonomy') : '', 'hover' => '', 'hover_dir' => '');
$post_data = getPostData($post_args);
showPostLayout($post_args, $post_data);
if (get_custom_option('show_filters') == 'yes') {
if (get_custom_option('filter_taxonomy') == 'tags') {
// Use tags as filter items
if (count($post_data['post_tags_list']) > 0) {
foreach ($post_data['post_tags_list'] as $tag) {
$flt_ids[$tag->term_id] = $tag->name;
}
}
}
}
}
if (!$post_number) {
if (is_search()) {
示例8: get_theme_option
<?php
}
?>
</div>
<div class="copy_socials socPage">
<ul>
<?php
$socials = get_theme_option('social_icons');
foreach ($socials as $s) {
if (empty($s['url'])) {
continue;
}
$sn = basename($s['icon']);
$sn = themerex_substr($sn, 0, themerex_strrpos($sn, '.'));
if (($pos = themerex_strrpos($sn, '_')) !== false) {
$sn = themerex_substr($sn, 0, $pos);
}
$soc = themerex_get_socials_url(basename($s['icon']));
//$s['icon'];
?>
<li><a class="social_icons social_<?php
echo $sn;
?>
" style="background-image: url(<?php
echo $soc;
?>
);" target="_blank" href="<?php
echo $s['url'];
?>
"><span style="background-image: url(<?php
echo $soc;
示例9: sc_graph
function sc_graph($atts, $content = null)
{
if (in_shortcode_blogger()) {
return '';
}
extract(shortcode_atts(array("id" => "", "labels" => "Label1, Label2, Label3", "type" => "Curve", "style" => "", "top" => "", "bottom" => "", "left" => "", "right" => "", "width" => ""), $atts));
themerex_enqueue_script('diagram-chart', get_template_directory_uri() . '/js/diagram/chart.min.js', array(), null, true);
themerex_enqueue_script('diagram-raphael', get_template_directory_uri() . '/js/diagram/diagram.raphael.js', array(), null, true);
themerex_enqueue_script('graph', get_template_directory_uri() . '/js/diagram/Graph.js', array('jquery'), null, true);
$ed_l = $left !== 'auto' ? themerex_substr($left, -1) == '%' ? '%' : 'px' : '';
$ed_r = $right !== 'auto' ? themerex_substr($right, -1) == '%' ? '%' : 'px' : '';
$s = ($top !== '' ? 'margin-top:' . $top . 'px;' : '') . ($bottom !== '' ? 'margin-bottom:' . $bottom . 'px;' : '') . ($left !== '' ? 'margin-left:' . $left . $ed_l . ';' : '') . ($right !== '' ? 'margin-right:' . $right . $ed_r . ';' : '') . ($width !== '' ? 'width:' . $width . 'px;' : '');
$content = do_shortcode($content);
if ($type == 'line') {
$type = 'Line';
}
return '<div class="tw-chart-graph tw-animate tw-redraw with-list-desc" data-zero="false" data-labels="' . $labels . '"' . 'data-type="' . $type . '" data-item-height="" data-animation-delay="0" data-animation-offset="90%" style="' . $s . '">' . '<ul class="data" style="display: none;">' . $content . '</ul>' . '<canvas></canvas>' . '</div>';
}
示例10: prepareThemeCustomStyles
function prepareThemeCustomStyles()
{
// Custom font
$fonts = getThemeFontsList(false);
$font = get_custom_option('theme_font');
$body_bg = get_custom_option('bg_color');
$theme_color = get_custom_option('theme_color');
if (isset($fonts[$font])) {
addThemeCustomStyle("\n\t\t\tbody, button, input, select, textarea {\n\t\t\t\tfont-family: '" . $font . "', " . $fonts[$font]['family'] . ";\n\t\t\t}\n\t\t\tbody {\n\t\t\t\tbackground: " . $body_bg . "\n\t\t\t}\n\t\t");
}
// Custom menu
if (get_custom_option('menu_colored') == 'yes') {
$menu_name = 'mainmenu';
if (($locations = get_nav_menu_locations()) && isset($locations[$menu_name])) {
$menu = wp_get_nav_menu_object($locations[$menu_name]);
if (is_object($menu) && $menu) {
$menu_items = wp_get_nav_menu_items($menu->term_id);
$menu_styles = '';
$menu_slider = get_custom_option('menu_slider') == 'yes';
if (count($menu_items) > 0) {
foreach ($menu_items as $k => $item) {
// if ($item->menu_item_parent==0) {
$cur_accent_color = '';
if ($item->type == 'taxonomy' && $item->object == 'category') {
$cur_accent_color = get_category_inherited_property($item->object_id, 'theme_accent_color');
}
if ((empty($cur_accent_color) || is_inherit_option($cur_accent_color)) && isset($item->classes[0]) && !empty($item->classes[0])) {
$cur_accent_color = (themerex_substr($item->classes[0], 0, 1) != '#' ? '#' : '') . $item->classes[0];
}
if (!empty($cur_accent_color) && !is_inherit_option($cur_accent_color)) {
$menu_styles .= ($item->menu_item_parent == 0 ? "#header_middle_inner #mainmenu li.menu-item-{$item->ID}.current-menu-item > a," : '') . "\n\t\t\t\t\t\t\t\t\t#header_middle_inner #mainmenu li.menu-item-{$item->ID} > a:hover,\n\t\t\t\t\t\t\t\t\t#header_middle_inner #mainmenu li.menu-item-{$item->ID}.sfHover > a {\n\t\t\t\t\t\t\t\t\t\tbackground-color: {$cur_accent_color} !important;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t#header_middle_inner #mainmenu li.menu-item-{$item->ID} ul {\n\t\t\t\t\t\t\t\t\t\tbackground-color: {$cur_accent_color} !important;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t";
}
if ($menu_slider && $item->menu_item_parent == 0) {
$menu_styles .= "\n\t\t\t\t\t\t\t\t\t#header_middle_inner #mainmenu li.menu-item-{$item->ID}.blob_over:not(.current-menu-item) > a:hover,\n\t\t\t\t\t\t\t\t\t#header_middle_inner #mainmenu li.menu-item-{$item->ID}.blob_over.sfHover > a {\n\t\t\t\t\t\t\t\t\t\tbackground-color: transparent !important;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t";
}
// }
}
}
if (!empty($menu_styles)) {
addThemeCustomStyle($menu_styles);
}
}
}
}
// Main menu height
$menu_height = (int) get_custom_option('menu_height');
if ($menu_height > 20) {
addThemeCustomStyle("\n\t\t\t#mainmenu > li > a {\n\t\t\t\theight: {$menu_height}px !important;\n\t\t\t\tline-height: {$menu_height}px !important;\n\t\t\t}\n\t\t\t#mainmenu > li ul {\n\t\t\t\ttop: {$menu_height}px !important;\n\t\t\t}\n\t\t\t#header_middle {\n\t\t\t\tmin-height: {$menu_height}px !important;\n\t\t\t}\n\t\t");
}
// Submenu width
$menu_width = (int) get_custom_option('menu_width');
if ($menu_width > 50) {
addThemeCustomStyle("\n\t\t\t#mainmenu > li ul {\n\t\t\t\twidth: {$menu_width}px;\n\t\t\t}\n\t\t\t#mainmenu > li ul li ul {\n\t\t\t\tleft: " . ($menu_width + 1) . "px;\n\t\t\t}\n\t\t\t#mainmenu > li:nth-child(n+6) ul li ul {\n\t\t\t\tleft: -" . ($menu_width + 1) . "px;\n\t\t\t}\n\t\t");
}
if (!empty($theme_color)) {
addThemeCustomStyle('
#sidebar_main .popular_and_commented_tabs .tab_content:not(.style_post_format) .post_item .post_title a:hover,
.wp-calendar thead th.prevMonth a:hover,
.wp-calendar thead th.nextMonth a:hover,
.wp-calendar tbody td.dayWithPost a:hover,
.widget_twitter .theme_text a,
.top_news_section .top_news_term a:hover,
a:hover,
.trex_accent_color,
.post_info .post_title a:hover,
.link_text_wrap a,
.sc_quote_icon,
article.format-link > .icon,
blockquote.sc_quote,
article.format-aside > .icon,
article.format-chat > .icon,
article.format-status > .icon,
#nav_pages ul li:hover a,
#nav_pages ul li:hover span,
#nav_pages ul li.pager_current span,
#nav_pages .pager_prev a:hover,
#nav_pages .pager_next a:hover,
.isotopeFiltr ul li a:hover,
section.author .user_links ul li span:hover,
.comment_content .review .label i,
.popularFiltr ul li.ui-state-active a span,
.prev_next_posts .prev_post_icon,
.prev_next_posts .next_post_icon,
.prev_next_posts .prev_post_link a:hover,
.prev_next_posts .next_post_link a:hover,
.link_pages a:hover,
.itemscope .post_tags a:hover,
.article_services section.comments li.comment .comment_header .comment_reply a,
.swpRightPos .sc_tabs .tabsMenuHead li.ui-tabs-active a,
.swpRightPos .sc_tabs .tabsMenuHead li a:hover,
.swpRightPos .addBookmark:hover i,
.swpRightPos .listBookmarks li:hover a,
#panelmenu li a:hover,
.popular_and_commented_tabs ul.tabs li a:hover,
.popular_and_commented_tabs .tab_content .post_item a:hover,
.popular_and_commented_tabs .tab_content .post_item i.format-icon.hover:before,
.footerWidget .popular_and_commented_tabs .tab_content h5.post_title a:hover,
#sidebar_main .widget ul li a:hover,
.sc_accordion.sc_accordion_style_1 .sc_accordion_item h4.sc_accordion_title i.icon,
.sc_dropcaps .sc_dropcap,
//.........这里部分代码省略.........
示例11: themerex_substr
}
}
}
?>
<span class="post_format theme_accent_bg <?php
echo $post_icon;
?>
"<?php
echo themerex_substr($post_accent_color, 0, 1) == '#' ? ' style="background-color: ' . $post_accent_color . '"' : '';
?>
></span>
<?php
if (get_custom_option('puzzles_style') == 'heavy' && $post_accent_category != '') {
?>
<span class="post_category theme_accent_bg"<?php
echo themerex_substr($post_accent_color, 0, 1) == '#' ? ' style="background-color: ' . $post_accent_color . '"' : '';
?>
><?php
echo $post_accent_category;
?>
</span>
<?php
}
?>
<?php
if (!$post_protected) {
if ($post_audio) {
// If post have audio - show it
echo $post_audio;
}
}
示例12: do_shortcode
//get_the_content() not used, because it trim content up to <!-- more --> in each case!
$post_content_prepared = do_shortcode($post_content_full);
} else {
// ----------------- New way to get title, excerpt and content -----------------------
$post_title = get_the_title();
global $more;
$old_more = $more;
$more = -1;
$post_content_full = get_the_content();
$post_content_prepared = do_shortcode($post_content_full);
$more = $old_more;
$post_content = get_the_content('<span class="readmore">' . __('Read more', 'themerex') . '</span>');
$post_excerpt = has_excerpt() || $post_protected ? get_the_excerpt() : '';
if (empty($post_excerpt)) {
if (($more_pos = themerex_strpos($post_content_full, '<span id="more-')) !== false) {
$post_excerpt = themerex_substr($post_content_full, 0, $more_pos);
} else {
$post_excerpt = in_array($post_format, array('quote', 'link')) ? $post_content : get_the_excerpt();
}
}
$post_excerpt = $post_descr = str_replace('[…]', '', force_balance_tags($post_excerpt));
}
// Substitute WP [gallery] shortcode
if (get_custom_option('substitute_gallery') == 'yes') {
$post_excerpt = substituteGallery($post_excerpt, $post_id, $thumb_size[$blog_style]['w'], $thumb_size[$blog_style]['h']);
$post_descr = substituteGallery($post_descr, $post_id, $thumb_size[$blog_style]['w'], $thumb_size[$blog_style]['h']);
$post_content = substituteGallery($post_content, $post_id, $thumb_size[$blog_style]['w'], $thumb_size[$blog_style]['h'], 'none', true);
}
$post_title = apply_filters('the_title', $post_title);
$post_descr = apply_filters(in_array($post_format, array('quote', 'link')) ? 'the_content' : 'the_excerpt', $post_descr);
$post_excerpt = apply_filters('the_excerpt', $post_excerpt);
示例13: themerex_substr
<?php
global $THEMEREX_usermenu, $THEMEREX_usermenu_show;
if (empty($THEMEREX_usermenu) || !$THEMEREX_usermenu_show) {
?>
<ul id="usermenu" class="usermenu_list">
<?php
} else {
$menu = themerex_substr($THEMEREX_usermenu, 0, themerex_strlen($THEMEREX_usermenu) - 5);
$pos = themerex_strpos($menu, '<ul');
if ($pos !== false) {
$menu = themerex_substr($menu, 0, $pos + 3) . ' class="usermenu_list"' . themerex_substr($menu, $pos + 3);
}
echo str_replace('class=""', '', $menu);
}
?>
<?php
if (is_woocommerce_page() && get_custom_option('show_currency') == 'yes') {
?>
<li class="usermenu_currency">
<a href="#">$</a>
<ul>
<li><a href="#"><b>$</b> <?php
_e('Dollar', 'themerex');
?>
</a></li>
<li><a href="#"><b>€</b> <?php
_e('Euro', 'themerex');
?>
</a></li>
示例14: sc_title
function sc_title($atts, $content = null)
{
extract(shortcode_atts(array("id" => "", "type" => "1", "style" => "regular", "icon" => "", "bubble_color" => "", "weight" => "", "top" => "", "bottom" => "", "left" => "", "right" => ""), $atts));
$s = ($top !== '' ? 'margin-top:' . $top . 'px;' : '') . ($bottom !== '' ? 'margin-bottom:' . $bottom . 'px;' : '') . ($left !== '' ? 'margin-left:' . $left . 'px;' : '') . ($right !== '' ? 'margin-right:' . $right . 'px;' : '') . ($weight ? 'font-weight:' . $weight . ';' : '');
$type = min(6, max(1, $type));
$icon_file = $icon != '' && file_exists(get_template_directory() . '/images/icons/' . $icon . '.png');
return '<h' . $type . ($id ? ' id="' . $id . '"' : '') . ($style == 'underline' ? ' class="sc_title_underline"' : (themerex_strpos($style, 'bubble') !== false ? ' class="sc_title_bubble sc_title_' . $style . '"' : (themerex_strpos($style, 'icon') !== false ? ' class="sc_title_icon sc_title_' . $style . '"' : ''))) . ($s != '' ? ' style="' . $s . '"' : '') . '>' . (themerex_substr($style, 0, 6) == 'bubble' ? '<span class="sc_title_bubble_icon ' . ($icon != '' && !$icon_file ? ' icon-' . $icon : '') . '"' . ($bubble_color != '' ? ' style="background-color:' . $bubble_color . '"' : '') . '>' . ($icon_file ? '<img src="' . get_template_directory_uri() . '/images/icons/' . $icon . '.png" />' : '') . '</span>' : (themerex_substr($style, 0, 4) == 'icon' ? '<img src="' . get_template_directory_uri() . '/images/icons/' . $icon . '.png" />' . ($style == 'icon_top' ? '<br />' : '') : '')) . do_shortcode($content) . '</h' . $type . '>';
}
示例15: esc_attr
<?php
$post_title_tag = $opt['style'] == 'list' ? 'li' : 'h5';
$reviewsBlock = '';
$title = '<' . esc_attr($post_title_tag) . ' class="sc_blogger_title sc_title' . (in_array($opt['style'], array('accordion_1', 'accordion_2')) ? ' sc_accordion_title' : '') . '">' . ((!isset($opt['links']) || $opt['links']) && !in_array($opt['style'], array('accordion_1', 'accordion_2')) ? '<a href="' . esc_url($post_data['post_link']) . '">' : '') . (themerex_substr($opt['style'], 0, 6) == 'bubble' ? '<span class="sc_title_bubble_icon ' . ($post_data['post_icon'] != '' ? ' ' . esc_attr($post_data['post_icon']) : '') . '"' . ($post_data['bubble_color'] != '' ? ' style="background-color:' . esc_attr($post_data['bubble_color']) . '"' : '') . '></span>' : '') . (in_array($opt['style'], array('accordion_1', 'accordion_2')) ? '<span class="sc_accordion_icon"></span>' : '') . esc_html($post_data['post_title']) . ((!isset($opt['links']) || $opt['links']) && !in_array($opt['style'], array('accordion_1', 'accordion_2')) ? '</a>' : '') . '</' . esc_attr($post_title_tag) . '>' . (in_array($opt['style'], array('accordion_1', 'accordion_2', 'list')) ? '' : $reviewsBlock);
if ($opt['style'] == 'list') {
echo balanceTags($title);
} else {
$thumb = $post_data['post_thumb'] && themerex_strpos($opt['style'], 'image') !== false ? '<div class="thumb hoverIncrease">' . ($post_data['post_link'] != '' ? balanceTags($post_data['post_thumb']) . '<a href="' . esc_url($post_data['post_link']) . '"><span class="hoverIcon"></span></a>' : balanceTags($post_data['post_thumb'])) . '<span class="hoverShadow"></span></div>' : '';
$info = sc_param_is_on($opt['info']) ? '<div class="sc_blogger_info">' . (themerex_strpos($opt['style'], 'image') !== false || themerex_strpos($opt['style'], 'accordion') !== false ? '<div class="sc_blogger_more sc_button sc_button_style_global sc_button_size_medium squareButton global medium"><a title="" href="' . esc_url($post_data['post_link']) . '">' . ($opt['readmore'] ? esc_html($opt['readmore']) : __('More', 'themerex')) . '</a></div><div class="sc_blogger_author">' . __('Posted by', 'themerex') : __('by', 'themerex')) . ' <a href="' . esc_url($post_data['post_author_url']) . '" class="post_author">' . esc_html($post_data['post_author']) . '</a>' . ($opt['counters'] != 'none' ? ' <span class="separator">|</span> ' . ($opt['orderby'] == 'comments' || $opt['counters'] == 'comments' ? __('Comments', 'themerex') : __('Views', 'themerex')) . ' <span class="comments_number">' . ($opt['orderby'] == 'comments' || $opt['counters'] == 'comments' ? esc_html($post_data['post_comments']) : esc_html($post_data['post_views'])) . '</span>' : '') . (themerex_strpos($opt['style'], 'image') !== false || themerex_strpos($opt['style'], 'accordion') !== false ? '</div>' : '') . '</div>' : '';
if ($opt['dir'] == 'horizontal' && $opt['style'] != 'date') {
?>
<div class="columns1_<?php
echo esc_attr($opt['posts_visible']);
?>
column_item_<?php
echo esc_attr($opt['number']);
echo ($opt['number'] % 2 == 1 ? ' odd' : ' even') . ($opt['number'] == 1 ? ' first' : '') . ($opt['number'] == $opt['posts_on_page'] ? ' columns_last' : '') . (sc_param_is_on($opt['scroll']) ? ' sc_scroll_slide swiper-slide' : '');
?>
">
<?php
}
?>
<article class="sc_blogger_item<?php
echo (in_array($opt['style'], array('accordion_1', 'accordion_2')) ? ' sc_accordion_item' : '') . ($opt['number'] == $opt['posts_on_page'] && !sc_param_is_on($opt['loadmore']) ? ' sc_blogger_item_last' : '') . (sc_param_is_on($opt['scroll']) && ($opt['dir'] == 'vertical' || $opt['style'] == 'date') ? ' sc_scroll_slide swiper-slide' : '');
?>
"<?php
echo $opt['dir'] == 'horizontal' && $opt['style'] == 'date' ? ' style="width:' . 100 / $opt['posts_on_page'] . '%"' : '';
?>
>