本文整理汇总了PHP中the_excerpt_max_charlength函数的典型用法代码示例。如果您正苦于以下问题:PHP the_excerpt_max_charlength函数的具体用法?PHP the_excerpt_max_charlength怎么用?PHP the_excerpt_max_charlength使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了the_excerpt_max_charlength函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get_participantbox
function get_participantbox($object_id)
{
?>
<div class="media">
<div class="media-left">
<a href="<?php
echo get_permalink($object_id);
?>
">
<?php
echo get_the_post_thumbnail($object_id, array(150, 150));
?>
</a>
</div>
<div class="media-body participant_title">
<h4 class="media-heading"><a href="<?php
echo get_permalink($object_id);
?>
"><?php
echo get_the_title($object_id);
?>
</a></h4>
<?php
echo the_excerpt_max_charlength($object_id, 130);
?>
</div>
</div>
<?php
}
开发者ID:eliascantoral,项目名称:guaflix,代码行数:29,代码来源:object_box.php
示例2: get_object_box
/**
* Description of object_logic
*
* @author Augusto
*/
function get_object_box($object)
{
$thepost = get_post($object);
//var_dump($thepost);
$url = wp_get_attachment_url(get_post_thumbnail_id($thepost->ID));
?>
<div class="ih-item square effect6 from_top_and_bottom"><a href="<?php
echo get_permalink($thepost->ID);
?>
">
<div class="img"><img src="<?php
echo $url;
?>
" alt="img"></div>
<div class="info">
<h3><?php
echo $thepost->post_title;
?>
</h3>
<p><?php
echo the_excerpt_max_charlength($thepost->ID, 50);
?>
</p>
</div></a>
</div>
<?php
}
开发者ID:eliascantoral,项目名称:guaflixv2,代码行数:32,代码来源:object_logic.php
示例3: blog_thumbnail_style
function blog_thumbnail_style($atts, $current)
{
global $post, $mk_options;
extract($atts);
$image_height = $grid_image_height;
if ($thumbnail_align == 'left') {
$align_class = ' content-align-right';
} else {
$align_class = ' content-align-left';
}
if ($layout == 'full') {
$image_width = $grid_width - 40;
} else {
$image_width = $content_width / 100 * $grid_width - 40;
}
$output = $has_image = '';
$post_type = get_post_meta($post->ID, '_single_post_type', true);
/*
* Image Width : 600px
* Image Height : 460px
*/
$image_src_array = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full', true);
$image_output_src = bfi_thumb($image_src_array[0], array('width' => '600', 'height' => '460'));
if ($post_type == '') {
$post_type = 'image';
}
$output .= '<article id="' . get_the_ID() . '" class="mk-blog-thumbnail-item thumbnail-' . $item_id . ' mk-isotop-item ' . $post_type . '-post-type' . $align_class . '">' . "\n";
if (has_post_thumbnail()) {
$output .= '<div class="featured-image" ><a href="' . get_permalink() . '" title="' . get_the_title() . '">';
$output .= ' <img alt="' . get_the_title() . '" title="' . get_the_title() . '" src="' . $image_output_src . '" itemprop="image" />';
$output .= ' <div class="image-hover-overlay"></div>';
$output .= ' <div class="post-type-badge" href="' . get_permalink() . '"><i class="mk-li-' . $post_type . '"></i></div>';
$output .= '</a></div>';
}
$output .= '<div class="mk-thumbnail-content-container">';
$output .= ' <div class="mk-blog-meta">';
$output .= ' <div class="mk-blog-author">';
ob_start();
the_author_posts_link();
$output .= ob_get_contents() . '</div>';
ob_get_clean();
$output .= ' <span class="mk-categories"> / ' . __('', 'mk_framework') . ' ' . get_the_category_list(', ') . ' </span> /
<time datetime="' . get_the_date() . '">
<a href="' . get_month_link(get_the_time("Y"), get_the_time("m")) . '">' . get_the_date() . '</a>
</time>';
$output .= ' <h3 class="the-title"><a href="' . get_permalink() . '">' . get_the_title() . '</a></h3>';
if ($excerpt_length != 0) {
ob_start();
the_excerpt_max_charlength($excerpt_length);
$output .= '<div class="the-excerpt"><p>' . ob_get_clean() . '</p></div>';
}
$output .= ' <div class="mk-teader-button">' . do_shortcode('[mk_button dimension="outline" corner_style="pointed" outline_skin="custom" outline_active_color="#000000" outline_hover_color="#fff" margin_bottom="0" size="medium" align="left" url="' . get_permalink() . '"]' . __('READ MORE', 'mk_framework') . '[/mk_button]') . '
</div>';
$output .= ' </div>';
$output .= ' </div>';
$output .= '<div class="clearboth"></div>';
$output .= '</article>' . "\n\n\n";
return $output;
}
开发者ID:kevalbaxi,项目名称:dosomething-blog,代码行数:59,代码来源:thumbnail.php
示例4: rbfaq_archive_loop
/**
* FAQ loop.
* We're replacing the Genesis loop with our own.
*/
function rbfaq_archive_loop()
{
$count = 0;
if (have_posts()) {
while (have_posts()) {
the_post();
//* Set up the count
$count++;
//* Figure out what class to apply to the image
//* If the image
if ($count % 2 == 0) {
$imageclass = 'member-image member-image-left';
} else {
$imageclass = 'member-image member-image-right';
}
printf('<div class="%s">', implode(' ', get_post_class('member-section')));
/**
* Output the image
* We're only going to link the image if there's something to link to
*/
if (get_the_content() && ($image = genesis_get_image('format=url&size=member-image'))) {
printf('<div class="portfolio-image"><a href="%s" rel="bookmark"><img class="%s" src="%s" alt="%s" /></a></div>', get_permalink(), $imageclass, $image, the_title_attribute('echo=0'));
} elseif ($image = genesis_get_image('format=url&size=member-image')) {
printf('<div class="portfolio-image"><img class="%s" src="%s" alt="%s" /></div>', $imageclass, $image, the_title_attribute('echo=0'));
}
echo '<div class="member-content">';
edit_post_link('Edit this member', '<small>', '</small>', '');
//* Only link the title if there's some content to link to
if (get_the_content()) {
printf('<h2 class="entry-title"><a href="%s">%s</a></h2>', get_the_permalink(), get_the_title());
} else {
printf('<h2 class="entry-title">%s</h2>', get_the_title());
}
//* Add the member's title
global $post;
$title = get_post_meta(get_the_ID(), '_rbm_members_title', true);
if ($title) {
printf('<h4 class="member-subtitle">%s</h4>', $title);
}
echo '<p>';
the_excerpt_max_charlength(250);
echo '</p>';
if (get_the_content()) {
printf('<a class="button" href="%s">Read more</a>', get_the_permalink());
}
echo '</div>';
// .member-content
echo '</div>';
// the post_class() div
}
// end while
}
// end if
}
开发者ID:redblueconcepts,项目名称:redblue-members,代码行数:58,代码来源:archive-member-types.php
示例5: get_objectdata
function get_objectdata($object_id)
{
//$return = array();
$post = get_post($object_id);
//print_array($post);
$post_title = $post->post_title;
$abst_size = strlen($post_title) > 35 ? 65 : 130;
$time = get_field("tiempo", $post->ID);
$field = array();
$autor = get_field("participant", $post->ID);
if ($autor) {
array_push($field, array("Autor", get_the_title($autor[0])));
}
$return = array($post->ID, $post_title, get_permalink($post->ID), the_excerpt_max_charlength($post->ID, $abst_size), "", $field);
return $return;
}
开发者ID:eliascantoral,项目名称:guaflix,代码行数:16,代码来源:logic.php
示例6: widget
function widget($args, $instance)
{
extract($args);
$title = apply_filters('CWS_Widget_Latest_Posts', $instance['title']);
$head = '';
if ($title && $title != '') {
$head = '<h3 class="widget-title">' . $title . '</h3>';
}
global $post;
$category = !empty($instance['category']) ? absint($instance['category']) : 0;
$post_query = array('numberposts' => 3, 'cat' => $category);
if ($instance['num_to_show']) {
$post_query['numberposts'] = $instance['num_to_show'];
}
if ($instance['show_date']) {
$post_query['show_date'] = $instance['show_date'];
}
$show_date = $instance['show_date'] ? $instance['show_date'] : false;
$myposts = get_posts($post_query);
echo $before_widget;
echo '<div class="latest-posts-widget">' . $head . '<div class="widget-content"><ul>';
//$myposts = get_posts( $post_query );
foreach ($myposts as $post) {
$thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_id()), 'full', true);
setup_postdata($post);
echo '<li>';
if (has_post_thumbnail()) {
echo '<div class="kids_image_wrapper ">';
echo '<a href="' . $thumbnail[0] . '" class="prettyPhoto kids_mini_picture" data-rel="prettyPhoto[rpwt]">';
echo '<img src="' . bfi_thumb($thumbnail[0], array('width' => 70, 'height' => 70, 'crop' => true)) . '" width="70" height="70" alt=""></a></div>';
}
echo '<div class="kids_post_content"><h4><a href="' . get_permalink() . '">' . get_the_title() . '</a></h4>';
if ($show_date) {
echo '<p>' . the_excerpt_max_charlength(25) . '</p>';
echo '<p class="time-post">' . get_the_date() . '</p>';
} else {
echo '<p>' . the_excerpt_max_charlength(40) . '</p>';
}
echo '</div></li>';
}
wp_reset_postdata();
echo '</ul></div></div>' . $args['after_widget'];
}
开发者ID:Makenrro,项目名称:repos,代码行数:43,代码来源:latest_posts_w_thumbnails.php
示例7: social_share_list
function social_share_list($atts, $content = null)
{
global $qode_options_proya;
if (isset($qode_options_proya['twitter_via']) && !empty($qode_options_proya['twitter_via'])) {
$twitter_via = " via " . $qode_options_proya['twitter_via'] . " ";
} else {
$twitter_via = "";
}
$image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
$html = "";
if (isset($qode_options_proya['enable_social_share']) && $qode_options_proya['enable_social_share'] == "yes") {
$post_type = get_post_type();
if (isset($qode_options_proya["post_types_names_{$post_type}"])) {
if ($qode_options_proya["post_types_names_{$post_type}"] == $post_type) {
$html .= '<div class="social_share_list_holder">';
$html .= "<span>" . __('Share on: ', 'qode') . "</span>";
$html .= '<ul>';
if (isset($qode_options_proya['enable_facebook_share']) && $qode_options_proya['enable_facebook_share'] == "yes") {
$html .= '<li class="facebook_share">';
$html .= '<a title="' . __("Share on Facebook", "qode") . '" href="#" onclick="window.open(\'http://www.facebook.com/sharer.php?s=100&p[title]=' . urlencode(qode_addslashes(get_the_title())) . '&p[summary]=' . urlencode(qode_addslashes(strip_tags(get_the_excerpt()))) . '&p[url]=' . urlencode(get_permalink()) . '&&p[images][0]=';
if (function_exists('the_post_thumbnail')) {
$html .= wp_get_attachment_url(get_post_thumbnail_id());
}
$html .= '\', \'sharer\', \'toolbar=0,status=0,width=620,height=280\');">';
if (!empty($qode_options_proya['facebook_icon'])) {
$html .= '<img src="' . $qode_options_proya["facebook_icon"] . '" alt="" />';
} else {
$html .= '<i class="fa fa-facebook"></i>';
}
$html .= "</a>";
$html .= "</li>";
}
if ($qode_options_proya['enable_twitter_share'] == "yes") {
$html .= '<li class="twitter_share">';
$html .= '<a href="#" title="' . __("Share on Twitter", 'qode') . '" onclick="popUp=window.open(\'http://twitter.com/home?status=' . urlencode(the_excerpt_max_charlength(mb_strlen(get_permalink())) . $twitter_via) . get_permalink() . '\', \'popupwindow\', \'scrollbars=yes,width=800,height=400\');popUp.focus();return false;">';
if (!empty($qode_options_proya['twitter_icon'])) {
$html .= '<img src="' . $qode_options_proya["twitter_icon"] . '" alt="" />';
} else {
$html .= '<i class="fa fa-twitter"></i>';
}
$html .= "</a>";
$html .= "</li>";
}
if ($qode_options_proya['enable_google_plus'] == "yes") {
$html .= '<li class="google_share">';
$html .= '<a href="#" title="' . __("Share on Google+", "qode") . '" onclick="popUp=window.open(\'https://plus.google.com/share?url=' . urlencode(get_permalink()) . '\', \'popupwindow\', \'scrollbars=yes,width=800,height=400\');popUp.focus();return false">';
if (!empty($qode_options_proya['google_plus_icon'])) {
$html .= '<img src="' . $qode_options_proya['google_plus_icon'] . '" alt="" />';
} else {
$html .= '<i class="fa fa-google-plus"></i>';
}
$html .= "</a>";
$html .= "</li>";
}
if (isset($qode_options_proya['enable_linkedin']) && $qode_options_proya['enable_linkedin'] == "yes") {
$html .= '<li class="linkedin_share">';
$html .= '<a href="#" class="' . __("Share on LinkedIn", "qode") . '" onclick="popUp=window.open(\'http://linkedin.com/shareArticle?mini=true&url=' . urlencode(get_permalink()) . '&title=' . urlencode(get_the_title()) . '\', \'popupwindow\', \'scrollbars=yes,width=800,height=400\');popUp.focus();return false">';
if (!empty($qode_options_proya['linkedin_icon'])) {
$html .= '<img src="' . $qode_options_proya['linkedin_icon'] . '" alt="" />';
} else {
$html .= '<i class="fa fa-linkedin"></i>';
}
$html .= "</a>";
$html .= "</li>";
}
if (isset($qode_options_proya['enable_tumblr']) && $qode_options_proya['enable_tumblr'] == "yes") {
$html .= '<li class="tumblr_share">';
$html .= '<a href="#" title="' . __("Share on Tumblr", "qode") . '" onclick="popUp=window.open(\'http://www.tumblr.com/share/link?url=' . urlencode(get_permalink()) . '&name=' . urlencode(get_the_title()) . '&description=' . urlencode(get_the_excerpt()) . '\', \'popupwindow\', \'scrollbars=yes,width=800,height=400\');popUp.focus();return false">';
if (!empty($qode_options_proya['tumblr_icon'])) {
$html .= '<img src="' . $qode_options_proya['tumblr_icon'] . '" alt="" />';
} else {
$html .= '<i class="fa fa-tumblr"></i>';
}
$html .= "</a>";
$html .= "</li>";
}
if (isset($qode_options_proya['enable_pinterest']) && $qode_options_proya['enable_pinterest'] == "yes") {
$html .= '<li class="pinterest_share">';
$image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
$html .= '<a href="#" title="' . __("Share on Pinterest", "qode") . '" onclick="popUp=window.open(\'http://pinterest.com/pin/create/button/?url=' . urlencode(get_permalink()) . '&description=' . qode_addslashes(get_the_title()) . '&media=' . urlencode($image[0]) . '\', \'popupwindow\', \'scrollbars=yes,width=800,height=400\');popUp.focus();return false">';
if (!empty($qode_options_proya['pinterest_icon'])) {
$html .= '<img src="' . $qode_options_proya['pinterest_icon'] . '" alt="" />';
} else {
$html .= '<i class="fa fa-pinterest"></i>';
}
$html .= "</a>";
$html .= "</li>";
}
if (isset($qode_options_proya['enable_vk']) && $qode_options_proya['enable_vk'] == "yes") {
$html .= '<li class="vk_share">';
$image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
$html .= '<a href="#" title="' . __("Share on VK", "qode") . '" onclick="popUp=window.open(\'http://vkontakte.ru/share.php?url=' . urlencode(get_permalink()) . '&title=' . urlencode(get_the_title()) . '&description=' . urlencode(get_the_excerpt()) . '&image=' . urlencode($image[0]) . '\', \'popupwindow\', \'scrollbars=yes,width=800,height=400\');popUp.focus();return false">';
if (!empty($qode_options_proya['vk_icon'])) {
$html .= '<img src="' . $qode_options_proya['vk_icon'] . '" alt="" />';
} else {
$html .= '<i class="fa fa-vk"></i>';
}
$html .= "</a>";
$html .= "</li>";
}
//.........这里部分代码省略.........
开发者ID:lokenxo,项目名称:familygenerator,代码行数:101,代码来源:shortcodes.php
示例8: while
<?php
while ($jobBits->have_posts()) {
$jobBits->the_post();
$block_link = get_post_meta($post->ID, 'block_link', true);
?>
<li>
<a href="<?php
echo the_permalink();
?>
"
<header class="sticky"><?php
the_title();
?>
</header>
<p class="role_desc"><?php
the_excerpt_max_charlength(94);
?>
</p>
</a>
<a href="<?php
echo the_permalink();
?>
" class="read_more_cta">Read more and apply</a>
</li>
<?php
}
?>
</ul>
</div>
<?php
}
开发者ID:parsonsc,项目名称:dofe,代码行数:31,代码来源:contact.php
示例9: WP_Query
$r = new WP_Query($query);
$output .= '<div class="mk-shortcode mk-blog-showcase ' . $el_class . '">';
$output .= '<ul>';
$i = 0;
if ($r->have_posts()) {
while ($r->have_posts()) {
$r->the_post();
$i++;
$image_src_array = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full', true);
$image_src = bfi_thumb($image_src_array[0], array('width' => 260, 'height' => 180));
$first_el_class = $i == 1 ? 'mk-blog-first-el' : '';
$output .= '<li class="' . $first_el_class . '">';
$output .= '<div class="mk-blog-showcase-thumb"><div class="showcase-blog-overlay"></div><a href="' . get_permalink() . '"><i class="mk-jupiter-icon-plus-circle"></i></a><img src="' . $image_src . '" alt="' . get_the_title() . '" title="' . get_the_title() . '" /></div>';
$output .= '<div class="blog-showcase-extra-info">';
$output .= '<time datetime="' . get_the_date() . '">';
$output .= '<a href="' . get_month_link(get_the_time("Y"), get_the_time("m")) . '">' . get_the_date() . '</a>';
$output .= '</time>';
$output .= '<a class="blog-showcase-title" href="' . get_permalink() . '">' . get_the_title() . '</a><div class="clearboth"></div>';
if ($excerpt_length != 0) {
ob_start();
the_excerpt_max_charlength($excerpt_length);
$output .= '<div class="the-excerpt">' . ob_get_clean() . '</div>';
}
$output .= '<a href="' . get_permalink() . '" class="blog-showcase-more">' . __('Read more', 'mk_framework') . '<i class="mk-icon-double-angle-right"></i></a>';
$output .= '</div>';
$output .= '</li>';
}
wp_reset_query();
}
$output .= '<div class="clearboth"></div></ul></div>';
echo $output;
开发者ID:kevalbaxi,项目名称:dosomething-blog,代码行数:31,代码来源:mk_blog_showcase.php
示例10: get_field
if (get_field('dien_tich')) {
?>
<p class="dien-tich">
<strong>Diện tích:</strong> <?php
echo get_field('dien_tich');
?>
</p>
<?php
}
?>
<?php
if ($category_cat && $category_cat[0]->slug != 'nguon-dia-oc') {
?>
<p class="description">
<?php
echo the_excerpt_max_charlength(12);
?>
</p>
<?php
}
?>
<div class="fs-comment">
<span>Bình chọn:</span>
<?php
//echo do_shortcode('[ratings id="'. get_the_ID().'" results="true"]');
?>
<?php
if (function_exists('the_ratings')) {
the_ratings();
}
?>
开发者ID:vanlong200880,项目名称:tmdt,代码行数:31,代码来源:list_category.php
示例11: the_permalink
?>
<a href="<?php
the_permalink();
?>
" title="<?php
the_title_attribute();
?>
">
<?php
the_post_thumbnail();
?>
</a>
<?php
}
?>
<p class="text-justify"><?php
the_excerpt_max_charlength(280);
?>
<a href="<?php
the_permalink();
?>
">Read more</a></p>
<?php
}
}
?>
</div>
</div>
<?php
get_footer();
开发者ID:jbrauckmuller,项目名称:uf_caires,代码行数:31,代码来源:index.php
示例12: quicksand_filter
function quicksand_filter()
{
wp_reset_query();
if ($_POST['filter'] == 'all') {
$num_post = count(query_posts('post_type=' . $_POST['post_type'] . '&posts_per_page=' . $_POST['num_posts_per_page'] . '&paged=' . $_POST['page']));
} else {
$num_post = count(query_posts('meta_key=' . THEME_SLUG . 'type_portfolio&meta_value=' . $_POST['filter'] . '&post_type=' . $_POST['post_type'] . '&posts_per_page=' . $_POST['num_posts_per_page'] . '&paged=' . $_POST['page']));
}
$column_count = $_POST['column_count'];
$width_thumb = $_POST['width_thumb'];
$height_thumb = $_POST['height_thumb'];
$i = 0;
?>
<ul class="list-post">
<?php
while (have_posts()) {
the_post();
global $post;
$thumbnail = get_thumbnail($width_thumb, $height_thumb, '', get_the_title(), get_the_title());
$thumb = $thumbnail["fullpath"];
?>
<li class="item<?php
if ($i % $column_count == 0) {
echo ' start';
}
if (++$i % $column_count == 0 || $i == $num_post) {
echo ' end';
}
?>
" data-id="<?php
echo $post->ID;
?>
" title="<?php
echo $i;
?>
">
<?php
if ($thumb || ($video_link = get_post_meta($post->ID, THEME_SLUG . 'video_portfolio', true))) {
?>
<div class="image image-style">
<a class="thumbnail" href="<?php
the_permalink();
?>
">
<?php
if ($thumb) {
the_post_thumbnail(array($width_thumb, $height_thumb), array('class' => 'thumbnail-effect-1'));
} else {
echo get_thumbnail_video($video_link, $width_thumb, $height_thumb);
}
?>
</a>
<?php
if ($_POST['lightbox'] == 'true') {
if ($video_link) {
show_light_box($post, 'fancybox-group', '', $_POST['id_group'] . '-' . $post->ID);
} else {
show_light_box($post, 'fancybox-group', 'lightbox-' . $_POST['id_group'], $_POST['id_group'] . '-' . $post->ID);
}
}
?>
</div>
<?php
}
?>
<div class="detail<?php
if (!$thumb && !$video_link) {
echo ' noimage';
}
?>
">
<h2 class="entry-title"><a href="<?php
the_permalink();
?>
" title="<?php
printf(esc_attr__('Permalink to %s', 'wpdance'), the_title_attribute('echo=0'));
?>
" rel="bookmark"><?php
the_title();
?>
</a></h2>
<div class="entry-content">
<?php
the_excerpt_max_charlength(250);
?>
</div><!-- .entry-content -->
<a href="<?php
the_permalink();
?>
" class="read-more-btn button"><span><span><?php
_e('Read more', 'wpdance');
?>
</span></span></a>
</div>
</li>
<?php
}
?>
</ul>
//.........这里部分代码省略.........
开发者ID:proj-2014,项目名称:vlan247-test-wp2,代码行数:101,代码来源:quicksand.php
示例13: social_share_list
function social_share_list($atts, $content = null)
{
global $qode_options_proya;
if (isset($qode_options_proya['twitter_via']) && !empty($qode_options_proya['twitter_via'])) {
$twitter_via = " via " . $qode_options_proya['twitter_via'] . " ";
} else {
$twitter_via = "";
}
$image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
$html = "";
if (isset($qode_options_proya['enable_social_share']) && $qode_options_proya['enable_social_share'] == "yes") {
$post_type = get_post_type();
if (isset($qode_options_proya["post_types_names_{$post_type}"])) {
if ($qode_options_proya["post_types_names_{$post_type}"] == $post_type) {
$html .= '<div class="social_share_list_holder">';
$html .= "<span>" . __('Share on: ', 'qode') . "</span>";
$html .= '<ul>';
$is_mobile = (bool) preg_match('#\\b(ip(hone|od|ad)|android|opera m(ob|in)i|windows (phone|ce)|blackberry|tablet' . '|s(ymbian|eries60|amsung)|p(laybook|alm|rofile/midp|laystation portable)|nokia|fennec|htc[\\-_]' . '|mobile|up\\.browser|[1-4][0-9]{2}x[1-4][0-9]{2})\\b#i', $_SERVER['HTTP_USER_AGENT']);
if (isset($qode_options_proya['enable_facebook_share']) && $qode_options_proya['enable_facebook_share'] == "yes") {
$html .= '<li class="facebook_share">';
// if mobile, use different link to sharer.php service
if ($is_mobile) {
$html .= '<a title="' . __("Share on Facebook", "qode") . '" href="#" onclick="window.open(\'http://m.facebook.com/sharer.php?u=' . urlencode(get_permalink());
} else {
$html .= '<a title="' . __("Share on Facebook", "qode") . '" href="#" onclick="window.open(\'http://www.facebook.com/sharer.php?s=100&p[title]=' . urlencode(qode_addslashes(get_the_title())) . '&p[summary]=' . urlencode(qode_addslashes(strip_tags(get_the_excerpt()))) . '&p[url]=' . urlencode(get_permalink()) . '&&p[images][0]=';
if (function_exists('the_post_thumbnail')) {
$html .= wp_get_attachment_url(get_post_thumbnail_id());
}
}
$html .= '\', \'sharer\', \'toolbar=0,status=0,width=620,height=280\');">';
if (!empty($qode_options_proya['facebook_icon'])) {
$html .= '<img src="' . $qode_options_proya["facebook_icon"] . '" alt="" />';
} else {
$html .= '<i class="fa fa-facebook"></i>';
}
$html .= "</a>";
$html .= "</li>";
}
if ($qode_options_proya['enable_twitter_share'] == "yes") {
$html .= '<li class="twitter_share">';
// if mobile use different link to update status service
if ($is_mobile) {
$html .= '<a href="#" title="' . __("Share on Twitter", 'qode') . '" onclick="popUp=window.open(\'http://twitter.com/intent/tweet?text=' . urlencode(the_excerpt_max_charlength(mb_strlen(get_permalink())) . $twitter_via) . get_permalink() . '\', \'popupwindow\', \'scrollbars=yes,width=800,height=400\');popUp.focus();return false;">';
} else {
$html .= '<a href="#" title="' . __("Share on Twitter", 'qode') . '" onclick="popUp=window.open(\'http://twitter.com/home?status=' . urlencode(the_excerpt_max_charlength(mb_strlen(get_permalink())) . $twitter_via) . get_permalink() . '\', \'popupwindow\', \'scrollbars=yes,width=800,height=400\');popUp.focus();return false;">';
}
if (!empty($qode_options_proya['twitter_icon'])) {
$html .= '<img src="' . $qode_options_proya["twitter_icon"] . '" alt="" />';
} else {
$html .= '<i class="fa fa-twitter"></i>';
}
$html .= "</a>";
$html .= "</li>";
}
if ($qode_options_proya['enable_google_plus'] == "yes") {
$html .= '<li class="google_share">';
$html .= '<a href="#" title="' . __("Share on Google+", "qode") . '" onclick="popUp=window.open(\'https://plus.google.com/share?url=' . urlencode(get_permalink()) . '\', \'popupwindow\', \'scrollbars=yes,width=800,height=400\');popUp.focus();return false">';
if (!empty($qode_options_proya['google_plus_icon'])) {
$html .= '<img src="' . $qode_options_proya['google_plus_icon'] . '" alt="" />';
} else {
$html .= '<i class="fa fa-google-plus"></i>';
}
$html .= "</a>";
$html .= "</li>";
}
if (isset($qode_options_proya['enable_linkedin']) && $qode_options_proya['enable_linkedin'] == "yes") {
$html .= '<li class="linkedin_share">';
$html .= '<a href="#" class="' . __("Share on LinkedIn", "qode") . '" onclick="popUp=window.open(\'http://linkedin.com/shareArticle?mini=true&url=' . urlencode(get_permalink()) . '&title=' . urlencode(get_the_title()) . '\', \'popupwindow\', \'scrollbars=yes,width=800,height=400\');popUp.focus();return false">';
if (!empty($qode_options_proya['linkedin_icon'])) {
$html .= '<img src="' . $qode_options_proya['linkedin_icon'] . '" alt="" />';
} else {
$html .= '<i class="fa fa-linkedin"></i>';
}
$html .= "</a>";
$html .= "</li>";
}
if (isset($qode_options_proya['enable_tumblr']) && $qode_options_proya['enable_tumblr'] == "yes") {
$html .= '<li class="tumblr_share">';
$html .= '<a href="#" title="' . __("Share on Tumblr", "qode") . '" onclick="popUp=window.open(\'http://www.tumblr.com/share/link?url=' . urlencode(get_permalink()) . '&name=' . urlencode(get_the_title()) . '&description=' . urlencode(get_the_excerpt()) . '\', \'popupwindow\', \'scrollbars=yes,width=800,height=400\');popUp.focus();return false">';
if (!empty($qode_options_proya['tumblr_icon'])) {
$html .= '<img src="' . $qode_options_proya['tumblr_icon'] . '" alt="" />';
} else {
$html .= '<i class="fa fa-tumblr"></i>';
}
$html .= "</a>";
$html .= "</li>";
}
if (isset($qode_options_proya['enable_pinterest']) && $qode_options_proya['enable_pinterest'] == "yes") {
$html .= '<li class="pinterest_share">';
$image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
$html .= '<a href="#" title="' . __("Share on Pinterest", "qode") . '" onclick="popUp=window.open(\'http://pinterest.com/pin/create/button/?url=' . urlencode(get_permalink()) . '&description=' . qode_addslashes(get_the_title()) . '&media=' . urlencode($image[0]) . '\', \'popupwindow\', \'scrollbars=yes,width=800,height=400\');popUp.focus();return false">';
if (!empty($qode_options_proya['pinterest_icon'])) {
$html .= '<img src="' . $qode_options_proya['pinterest_icon'] . '" alt="" />';
} else {
$html .= '<i class="fa fa-pinterest"></i>';
}
$html .= "</a>";
$html .= "</li>";
}
if (isset($qode_options_proya['enable_vk']) && $qode_options_proya['enable_vk'] == "yes") {
//.........这里部分代码省略.........
开发者ID:BaristaCom,项目名称:wp-base,代码行数:101,代码来源:shortcodes.php
示例14: get_field
}
// create json map
$address = get_field('address');
$dataLatLng = geocode($address);
$news = '';
if (get_field('new')) {
$news = '<div class="news-icon"><span>New</span></div>';
} else {
if (get_field('page_hot')) {
$news = '<div class="news-icon hot"><span>Hot</span></div>';
}
}
$url = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$total_comment = getFacebookDetails($url);
$ratings = the_ratings_results(get_the_ID());
$jsonData[] = array('title' => get_the_title(), 'lng' => $dataLatLng[0], 'lat' => $dataLatLng[1], 'address' => '', 'description' => '<p class="description">' . the_excerpt_max_charlength(18) . '</p>', 'vote' => '<div class="fs-comment"><span>Bình chọn:</span>' . $ratings . '</div>', 'img' => $img, 'baseurl' => get_the_permalink(), 'hot' => $news);
?>
<?php
}
?>
</ul>
<?php
$defaultLng = 10.7596132;
$defaultLat = 106.6644058;
if ($jsonData) {
foreach ($jsonData as $val) {
if (!empty($val['lng']) || !empty($val['lat'])) {
$defaultLng = $val['lng'];
$defaultLat = $val['lat'];
break;
开发者ID:vanlong200880,项目名称:tmdt,代码行数:31,代码来源:search.php
示例15: vc_latest_news_function
function vc_latest_news_function($atts, $content = null)
{
$output = '';
extract(shortcode_atts(array('lastest_news_title' => '', 'latest_news_icon' => '', 'select_categories' => '', 'lastest_news_button' => '', 'lastest_news_view_all' => '', 'count_word' => '', 'extra_class' => ''), $atts));
$output .= '<div id="blog-section" class="blog-section ow-section ' . $extra_class . '">';
$output .= '<div class="container">';
$output .= '<div class="section-header">';
$output .= '<h3><img src="' . wp_get_attachment_url($latest_news_icon) . '" alt="sep-icon" />' . $lastest_news_title . '</h3>';
$output .= '</div>';
$output .= '';
if (is_numeric($select_categories) && $select_categories >= 0) {
$list_post = get_posts(['category' => $select_categories, 'posts_per_page' => 2]);
foreach ($list_post as $post) {
setup_postdata($post);
$content = get_the_content();
$output .= '<article class="col-md-6 col-sm-12">';
$output .= '<div class="blog-box">';
$output .= '<div class="blog-box-inner">';
$output .= '<header class="entry-header">';
$output .= '<h3><a title="' . get_the_title($post->ID) . '" href="' . get_post_permalink($post->ID) . '">' . get_the_title($post->ID) . '</a></h3>';
$output .= '</header>';
$output .= '<footer class="entry-footer">';
$output .= '<span class="byline">';
$output .= '<span class="screen-reader-text">' . __('BY', KC_DOMAIN) . ' </span>';
$output .= author_link();
$output .= '</span> ';
$output .= '<span class="byline">';
$output .= '<span class="screen-reader-text">' . __('Likes', KC_DOMAIN) . ' </span>';
$output .= '<a title="Likes" href="#">23</a> </span>';
$output .= '</footer>';
$output .= '<div class="entry-content">';
$output .= '<p>' . the_excerpt_max_charlength($content, $count_word) . ' ...</p>';
$output .= '</div>';
$output .= '<a title="' . $lastest_news_button . '" href="' . get_post_permalink($post->ID) . '">' . $lastest_news_button . '</a>';
$output .= '</div>';
$output .= '<div class="entry-cover pull-right last-new-home">';
$output .= '<a title="' . $post->post_title . '" href="' . get_post_permalink($post->ID) . '" >' . get_the_post_thumbnail($post->ID, "medium") . ' </a>';
|
请发表评论