function get_post_featured_image_url($id = null) { if (is_null($id)) { $id = get_the_id(); } $featured_image = get_the_post_thumbnail($id, 'full'); if (strlen($featured_image) == 0) { return 'image not found'; } else { $image_url = catch_that_image($featured_image); return $image_url; } }
function insert_fb_in_head() { global $post; if (!is_singular()) { //if it is not a post or a page echo '<meta property="fb:admins" content="690907201"/>'; echo '<meta property="og:title" content="' . get_bloginfo('name') . '"/>'; echo '<meta property="og:type" content="website"/>'; echo '<meta property="og:locale" content="fr_FR"/>'; echo '<meta property="og:url" content="' . get_bloginfo('url') . '"/>'; echo '<meta property="og:site_name" content="' . get_bloginfo('name') . ' : ' . get_bloginfo('description') . '"/>'; echo "<meta property=\"og:description\" content=\"" . get_bloginfo('description') . "\"/>"; echo '<meta property="og:image" content="' . get_bloginfo('stylesheet_directory') . '/images/avatar_fb.jpg" />'; return; } else { echo '<meta property="fb:admins" content="690907201"/>'; echo '<meta property="og:title" content="' . get_bloginfo('name') . " - " . get_the_title() . '"/>'; echo '<meta property="og:type" content="article"/>'; echo '<meta property="og:locale" content="fr_FR"/>'; echo '<meta property="og:url" content="' . get_permalink() . '"/>'; echo '<meta property="og:site_name" content="' . get_bloginfo('name') . ' : ' . get_bloginfo('description') . '"/>'; } $content = $post->post_content; $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); $meta = strip_tags($content); $meta = str_replace(array("\n", "\r", "\t"), ' ', $meta); $meta = cut_text($meta); echo "<meta property=\"og:description\" content=\"" . $meta . "\"/>"; $custom_fields = get_post_custom($post->ID); $elts = explode("\r\n", $custom_fields['illustration'][0]); if ("" . $elts[0] != "") { //the post does not have featured image, use a default image $img = catch_that_image(); } else { $img = $elts[0]; } echo '<meta property="og:image" content="' . $img . '"/>'; }
function post_thumbnail($width, $height, $dataSrc) { global $post; $blogUrl = 'http://' . $_SERVER['HTTP_HOST']; $isTimThumb = get_option('themes_fo2_TimThumb'); $first_img_src = catch_that_image(); $timthumbFlod = str_replace($blogUrl, '', get_bloginfo("template_url")); if (has_post_thumbnail()) { //如果有缩略图,则显示缩略图 $timthumb_src = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full'); $timthumb_src = str_replace($blogUrl, '', $timthumb_src[0]); if (isset($dataSrc)) { if (!$isTimThumb) { $post_timthumb = '<img ' . $dataSrc . '="' . $timthumbFlod . '/timthumb.php?src=' . $timthumb_src . '&h=' . $height . '&w=' . $width . '&zc=1" alt="' . $post->post_title . '" />'; } else { $post_timthumb = '<img ' . $dataSrc . '="' . $timthumb_src . '" height="' . $height . '" width="' . $width . '" alt="' . $post->post_title . '" />'; } } else { if (!$isTimThumb) { $post_timthumb = '<img src=' . $timthumbFlod . '/timthumb.php?src=' . $timthumb_src . '&h=' . $height . '&w=' . $width . '&zc=1" alt="' . $post->post_title . '" />'; } else { $post_timthumb = '<img src="' . $timthumb_src . '" height="' . $height . '" width="' . $width . '" alt="' . $post->post_title . '" />'; } } if (isset($timthumb_src[5])) { echo $post_timthumb; } } else { $first_img_src = str_replace($blogUrl, '', $first_img_src); if (!empty($first_img_src)) { //如果日志中有图片 if (isset($dataSrc)) { if (!$isTimThumb) { $post_timthumb = '<img ' . $dataSrc . '="' . $timthumbFlod . '/timthumb.php?src=' . $first_img_src . '&h=' . $height . '&w=' . $width . '&zc=1" alt="' . $post->post_title . '" />'; } else { $post_timthumb = '<img ' . $dataSrc . '="' . $first_img_src . '" height="' . $height . '" width="' . $width . '" alt="' . $post->post_title . '" />'; } } else { if (!$isTimThumb) { $post_timthumb = '<img src="' . $timthumbFlod . '/timthumb.php?src=' . $first_img_src . '&h=' . $height . '&w=' . $width . '&zc=1" alt="' . $post->post_title . '" />'; } else { $post_timthumb = '<img src="' . $first_img_src . '" height="' . $height . '" width="' . $width . '" alt="' . $post->post_title . '" />'; } } } else { //如果日志中没有图片,则显示默认 if (isset($dataSrc)) { $post_timthumb = '<img ' . $dataSrc . '="' . get_bloginfo("template_url") . '/images/default_thumb.gif" alt="' . $post->post_title . '" />'; } else { $post_timthumb = '<img src="' . get_bloginfo("template_url") . '/images/default_thumb.gif" alt="' . $post->post_title . '" />'; } } echo $post_timthumb; } }
function mmimg($postID) { $cti = catch_that_image(); $showimg = $cti; has_post_thumbnail(); if (has_post_thumbnail()) { $thumbnail_image_url = wp_get_attachment_image_src(get_post_thumbnail_id(), 'thumbnail'); $shareimg = $thumbnail_image_url[0]; } else { $shareimg = $showimg; } return $shareimg; }
$first_img = "images/noimages.jpg"; } return $first_img; } $conn = mysqli_connect($config->mysqlhostname, $config->mysqluser, $config->mysqlpass, $config->mysqldbname, $config->mysqlport); $sql = "SELECT post_date,post_content,post_title,post_status,post_type,guid FROM wp_posts WHERE post_status='publish' AND post_type='post' LIMIT 10"; $query = mysqli_query($conn, $sql) or die(mysqli_error()); echo "<div class='elgg-module elgg-module-highlight elgg-module-featured'>"; echo "<div class='elgg-head'><h3>Latest News</h3></div>"; echo "<div class='elgg-body'>"; echo "<ul class='igolf-news'>"; while ($row1 = mysqli_fetch_array($query)) { echo "<li>"; ?> <img src="<?php echo catch_that_image($row1['post_content']); ?> " /> <div class="igolf_news_intro"> <a href="<?php echo $row1['guid']; ?> " target="_blank"><h3><?php echo $row1['post_title']; ?> </h3></a> <div class="igolf_news_content"> <?php $content = $row1['post_content']; $content = preg_replace("/<img[^>]+\\>/i", "", $content); echo substr($content, 0, 130) . "...";
<?php if ($wpzoom_archive_thumb == 'Show') { ?> <?php unset($img); if (current_theme_supports('post-thumbnails') && has_post_thumbnail()) { $thumbURL = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), ''); $img = $thumbURL[0]; } else { unset($img); if ($wpzoom_cf_use == 'Yes') { $img = get_post_meta($post->ID, $wpzoom_cf_photo, true); } else { if (!$img) { $img = catch_that_image($post->ID); } } } if ($img) { $img = wpzoom_wpmu($img); ?> <div class="thumb"><a href="<?php the_permalink(); ?> " rel="bookmark" title="<?php the_title(); ?> "><img src="<?php bloginfo('template_directory'); ?>
<div class="main"> <div class="content"> <!--左侧新闻--> <div class="left box"> <ul class="news"> <?php if (have_posts()) { while (have_posts()) { the_post(); ?> <?php setPostViews(get_the_ID()); ?> <?php $fmimg = get_post_meta($post->ID, "fmimg_value", true); $cti = catch_that_image(); if ($fmimg) { $showimg = $fmimg; } else { $showimg = $cti; } ?> <li style="background:none"> <h2 style="color:#333"> <?php the_title(); ?> </h2> <?php the_content(); ?>
function show_posts_fade($PreFeature = '', $PostFeature = '', $AlwaysShow = false, $categoryID = 0, $NumberOfPosts = 0) { global $wpdb; $options = get_option('show_post_fade_featuredpost'); ?> <script type="text/javascript"> jQuery(document).ready(function() { //alert ('sdfsd'); var $active; var image_fade_out = <?php echo $options['image_fade_out']; ?> ; var image_fade_in = <?php echo $options['image_fade_in']; ?> ; var txt_fade_out = <?php echo $options['txt_fade_out']; ?> ; var txt_fade_in = <?php echo $options['txt_fade_in']; ?> ; //alert (fade_out_image); /*for (n=0; n<3; n++) { $('.topstory-box-img').eq(n).hide().css({opacity: 0.0}); $('.topstory-box-txt').eq(n).hide().css({opacity: 0.0}); } */ jQuery('.topstory').hide(); jQuery('.topstory-box-img').hide(); jQuery('.topstory-box-txt').hide(); $active = jQuery('.topstory').eq(0); $active.addClass('active'); //$active.fadeTo(500,1); //var $oldactive = $('.topstory.active'); jQuery('.topstory').eq(0).show(); jQuery('.topstory-box-img').eq(0).show().fadeTo(image_fade_in,1); jQuery('.topstory-box-txt').eq(0).show().fadeTo(txt_fade_in,1); jQuery('.topstory').eq(1).hide(); jQuery('.topstory').eq(2).hide(); //$oldactive.fadeTo(1200,0); //Paging + Slider Function rotate = function(){ //var triggerID = $active.attr("rel") - 1; //Get number of times to slide //var image_reelPosition = triggerID * imageWidth; //Determines the distance the image reel needs to slide var $temp = $active; var tmp = $temp.index() - 1; //alert (tmp); jQuery('.topstory-box-img').eq(tmp).fadeTo (image_fade_out,0,function() { $temp .removeClass('active') .addClass('last-active'); jQuery('.topstory-box-txt').eq(tmp).fadeTo (txt_fade_out,0,function() { $temp.hide(); }); $active = $active.next(); if ( $active.length === 0) $active = jQuery('.topstory:first'); $active.addClass('active'); $active.show(); var tmp2 = $active.index() -1; jQuery('.topstory-box-img').eq(tmp2).fadeTo (image_fade_in,1); jQuery('.topstory-box-txt').eq(tmp2).fadeTo (txt_fade_in,1); }); }; //Rotation + Timing Event rotateSwitch = function(){ play = setInterval(function(){ //Set timer - this will repeat itself every 3 seconds //$active = $('.topstory.active').next(); //if ( $active.length === 0) { //If paging reaches the end... //$active = $('.topstory:first'); //go back to first //} rotate(); //Trigger the paging and slider function }, 5500); //Timer speed in milliseconds (3 seconds) }; rotateSwitch(); //Run function on launch //On Hover jQuery(".topstory").hover(function() { clearInterval(play); //Stop the rotation }, function() { rotateSwitch(); //Resume rotation //rotate(); }); //On Click //$(".paging a").click(function() { // $active = $(this); //Activate the clicked paging //Reset Timer // clearInterval(play); //Stop the rotation //rotate(); //Trigger rotation immediately //rotateSwitch(); // Resume rotation //return false; //Prevent browser jump to link anchor // }); }); </script> <?php //wp_enqueue_script("jquery"); // wp_deregister_script( 'jquery' ); // wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js'); $options = get_option('show_post_fade_featuredpost'); if (!$AlwaysShow) { if ($options['show_featured'] != 'show') { return; } } if ($categoryID == 0) { $show_category = explode(" ", $options['show_category']); if (sizeof($show_category) == 0) { return; } } else { if (!is_numeric($categoryID)) { return; } $show_category = explode(" ", $categoryID); } $sqlcat = "( "; $count = 0; foreach ($show_category as $cat) { if ($count > 0) { $sqlcat = $sqlcat . " OR "; } $sqlcat = $sqlcat . "{$wpdb->term_taxonomy}.term_id = " . $cat; $count = $count + 1; } $sqlcat = $sqlcat . " )"; if (!is_numeric($options['num_posts'])) { $num_posts = '1'; } else { $num_posts = $options['num_posts']; } if (!is_numeric($options['image_fade_out'])) { $image_fade_out = 800; } else { $image_fade_out = $options['image_fade_out']; } if ($NumberOfPosts > 0) { $num_posts = $NumberOfPosts; } if (empty($options['more_text'])) { $more_text = 'Read more →'; } else { $more_text = $options['more_text']; } $sqlposts = ''; // shows pages and posts if ($options['show_posts'] != 'Y' && $options['show_pages'] != 'Y') { // not checked, default to show posts only $sqlposts = " AND {$wpdb->posts}.post_type = 'post' "; } else { if ($options['show_posts'] == 'Y' && $options['show_pages'] != 'Y') { // show only posts $sqlposts = " AND {$wpdb->posts}.post_type = 'post' "; } elseif ($options['show_posts'] != 'Y' && $options['show_pages'] == 'Y') { // show only pages $sqlposts = " AND {$wpdb->posts}.post_type = 'page' "; } // if both checked do nothing and pages and posts shown by default } $div_title = $options['div_title']; if (empty($div_title)) { $div_title = "Featured Post"; } $posts = mysql_query("\n\t\tSELECT * FROM {$wpdb->posts}\n\t\tLEFT JOIN {$wpdb->term_relationships} ON\n\t\t({$wpdb->posts}.ID = {$wpdb->term_relationships}.object_id)\n\t\tLEFT JOIN {$wpdb->term_taxonomy} ON\n\t\t({$wpdb->term_relationships}.term_taxonomy_id = {$wpdb->term_taxonomy}.term_taxonomy_id)\n\t\tWHERE {$wpdb->posts}.post_status = 'publish'" . $sqlposts . "\n\t\tAND {$wpdb->term_taxonomy}.taxonomy = 'category'\n\t\tAND " . $sqlcat . " ORDER BY RAND()\n\t\tLIMIT " . $num_posts, $wpdb->dbh) or die(mysql_error() . ' on line: ' . __LINE__); if ($posts && mysql_num_rows($posts) > 0) { while ($thepost = mysql_fetch_object($posts)) { $myID = $thepost->ID; //if ($myID == 0) return; $thepost = get_post($myID); setup_postdata($thepost); ?> <div class="topstory"> <?php echo $PreFeature . "\n<div class=\"featuredpost\">\n"; /*echo "<h2><a href=\""; echo get_permalink($myID); echo "\" title=\""; echo apply_filters('the_title', $thepost->post_title); echo "\">"; echo apply_filters('the_title', $thepost->post_title); echo "</a></h2>\n";*/ echo '<div class="topstory-box-img">'; if (has_post_thumbnail()) { echo "<a href=\""; echo get_permalink($myID); echo "\" title=\""; echo apply_filters('the_title', $thepost->post_title); echo "\">"; echo '<img src="' . catch_that_image($thepost) . '">'; //the_post_thumbnail();//array(320,320)); echo "</a>\n"; } echo "</div>"; ?> <div class="topstory-box-txt"> <?php echo "<h3>" . $div_title . "</h3>\n"; ?> <h1><?php echo '<span style="font-size:' . $options['headline_size'] . 'em !important; line-height:0.9em !important; ">'; ?> <a href="<?php echo get_permalink($myID); ?> " title="<?php the_title_attribute(); ?> "><?php echo apply_filters('the_title', $thepost->post_title); ?> </a></span></h1> <div class="mousetxt">Mouse over - stop slideshow - out continue.</div> <?php $excerpt_letters = $options['excerpt_letters']; //echo "<a href=\""; //echo get_permalink($myID); //echo "\" title=\""; //echo apply_filters('the_title', $thepost->post_title); //echo "\"></a>"; //$options['show_headline_only'] = trim($_POST['show_headline_only'],'{}'); //$options['headline_size'] = trim($_POST['headline_size'],'{}'); //echo $options['show_headline_only']; if ($options['show_headline_only'] != 'Y') { echo "<a href=\""; echo get_permalink($myID); echo "\" title=\""; echo apply_filters('the_title', $thepost->post_title); echo "\">"; if ($excerpt_letters > 0) { $tmp = $thepost->post_content; $tmp = preg_replace("/\\[caption.*\\[\\/caption\\]/", '', $tmp); //echo $tmp; $tmp = substr($tmp, 0, $excerpt_letters); $tmp = strip_tags($tmp); echo $tmp; //the_content(''); } else { $tmp = $thepost->post_content; $tmp = preg_replace("/\\[caption.*\\[\\/caption\\]/", '', $tmp); $tmp = substr($tmp, 0, strpos($thepost->post_content, "<!--more-->")); $tmp = strip_tags($tmp); echo $tmp; //echo apply_filters('the_content', substr($thepost->post_content,0,$moreposition)); } echo "</a>\n"; } //echo apply_filters('the_content', substr($tmp,0,300)); //echo apply_filters('the_excerpt', $thepost->post_excerpt) . '...'; ?> <?php echo "<a href=\""; echo get_permalink($myID); echo "\" title=\""; echo apply_filters('the_title', $thepost->post_title); echo "\">" . $more_text . "</a>\n"; echo "</div></div></div>\n"; } // end while } // else no posts found }
get_header(); ?> <div class="site-download"> <div id="site-breadcrumbs"> <?php NQD_breadcrumbs(); ?> </div> <div class="post-container"> <div class="post-info" itemscope itemtype="http://data-vocabulary.org/Recipe"> <div class="post_thumb"> <img itemprop="photo" src="<?php bloginfo('home'); ?> /media/resizer/57x57/r/<?php echo remove_http(catch_that_image()); ?> " title="<?php the_title(); ?> "> </div> <h1 itemprop="name"><?php the_title(); ?> </h1> <div class="info"> <span class="post_date"><?php echo time_stamp(get_post_time('U', true)); ?> </span>
<?php /** * The default template for displaying the content blocks. Used for both single and index/archive/search. * * @subpackage jumpoff */ ?> <article id="post-<?php the_ID(); ?> " class="has-table"> <div class="row-table"> <section class="half has-bgimg" style="background-image:url('<?php echo catch_that_image($page->ID, 'fullsize'); ?> ');"></section> <section class="half has-content"> <div class="content"> <span class="post-meta"><?php the_time('F j, Y'); ?> - <?php the_author_posts_link(); ?> </span> <h2><a href="<?php the_permalink(); ?>
<?php if (function_exists('has_post_thumbnail') && has_post_thumbnail()) { ?> <a href="<?php echo catch_that_image(); ?> " class="magnifier"> <?php replican_get_thumbnail2(120, 87); ?> </a> <?php } else { ?> <?php catch_that_image(13000, 12000); ?> <?php replican_get_image2(120, 87); ?> </a><?php } ?> <?php } ?> </li> <?php } else {
function recent_news($args) { extract($args); $settings = get_option('widget_recent_news'); $number = $settings['number']; echo $before_widget; echo "{$before_title}" . "{$settings['title']}" . "{$after_title}"; ?> <ul class="news_widget"> <?php $recent = new WP_Query('caller_get_posts=1&showposts=' . $number); while ($recent->have_posts()) { $recent->the_post(); global $post; global $wp_query; ?> <li> <a href="<?php the_permalink(); ?> " rel="bookmark" title="<?php the_title(); ?> "> <?php unset($img); if (current_theme_supports('post-thumbnails') && has_post_thumbnail()) { $thumbURL = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), ''); $img = $thumbURL[0]; } else { unset($img); if ($wpzoom_cf_use == 'Yes') { $img = get_post_meta($post->ID, $wpzoom_cf_photo, true); } else { if (!$img) { $img = catch_that_image($post->ID); } } } if ($img) { $img = wpzoom_wpmu($img); ?> <img src="<?php bloginfo('template_directory'); ?> /scripts/timthumb.php?src=<?php echo $img; ?> &w=65&h=50&zc=1" alt="<?php the_title(); ?> " /> <?php } ?> </a> <a href="<?php the_permalink(); ?> " rel="bookmark" title="Permanent Link to <?php the_title(); ?> "><?php the_title(); ?> </a> <span class="meta"><?php the_time('F j, Y \\a\\t G:i'); ?> </span> </li> <?php } ?> </ul> <?php echo $after_widget; }
function bd_pin_image() { global $post, $posts; if (has_post_thumbnail($post->ID)) { $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full'); echo $image[0]; } else { echo catch_that_image(); } }
function jasFeaturedStories() { $jasFeaturedStories_options = get_option('jasFeaturedStories_options'); //preview mode, showing the saved options and not the published options $pub = ''; if (isset($_GET['jasFeaturedStoriesPreview'])) { if (!$_GET['jasFeaturedStoriesPreview']) { $pub = '_pub'; } } ?> <div id="featured-stories-wrapper"> <input type="hidden" id="featured-stories-cycle-time" value="<?php echo $jasFeaturedStories_options['cycle_time' . $pub]; ?> " /> <ul id="featured-stories" <?php if ($jasFeaturedStories_options['scroll' . $pub] == 'on') { echo 'class="jasFeaturedStoriesScroll"'; } ?> > <?php $prim = false; $sec = false; $tert = false; $url = $jasFeaturedStories_options['story1_link' . $pub]; $postId = url_to_postid($url); $post = get_post($postId); $title = stripslashes(stripslashes($jasFeaturedStories_options['story1_headline' . $pub])); if (strlen($title) == 0) { $title = $post->post_title; } $abstract = stripslashes(stripslashes($jasFeaturedStories_options['story1_abstract' . $pub])); $size = '&w=214&h=120'; if ($jasFeaturedStories_options['story1_primary'] == true) { $class = 'primary'; $size = '&w=428&h=241'; if (!$prim) { $class = 'primary current'; $prim = true; } } elseif (!$sec) { $class = 'secondary'; $sec = true; } elseif (!tert) { $class = 'tertiary'; $tert = true; } $imagesrc = ''; if (strlen($jasFeaturedStories_options['story1_imageUrl']) > 0) { $imagesrc = $jasFeaturedStories_options['story1_imageUrl']; } else { if (function_exists('catch_that_image')) { $imagesrc = catch_that_image($post); } } ?> <li class="<?php echo $class; ?> " id="story1"> <a class="panel" href="<?php echo $url; ?> " style="background-image:url('<?php bloginfo('template_directory'); ?> /timthumb/timthumb.php?src=<?php echo $imagesrc . $size; ?> &zc=1');"> <div class="text-container"> <h2><?php echo $title; ?> </h2> <p><?php echo $abstract; ?> </p> </div> </a> <!-- End Featured Box Panel --> </li> <?php $url = $jasFeaturedStories_options['story2_link' . $pub]; $postId = url_to_postid($url); $post = get_post($postId); $title = stripslashes(stripslashes($jasFeaturedStories_options['story2_headline' . $pub])); if (strlen($title) == 0) { $title = $post->post_title; } $abstract = stripslashes(stripslashes($jasFeaturedStories_options['story2_abstract' . $pub])); $size = '&w=214&h=120'; if ($jasFeaturedStories_options['story2_primary'] == true) { $class = 'primary'; $size = '&w=428&h=241'; if (!$prim) { $class = 'primary current'; $prim = true; } } elseif (!$sec) { $class = 'secondary'; $sec = true; } else { $class = 'tertiary'; $tert = true; } $imagesrc = ''; if (strlen($jasFeaturedStories_options['story2_imageUrl']) > 0) { $imagesrc = $jasFeaturedStories_options['story2_imageUrl']; } else { if (function_exists('catch_that_image')) { $imagesrc = catch_that_image($post); } } ?> <li class="<?php echo $class; ?> " id="story2"> <a class="panel" href="<?php echo $url; ?> " style="background-image:url('<?php bloginfo('template_directory'); ?> /timthumb/timthumb.php?src=<?php echo $imagesrc . $size; ?> &zc=1');"> <div class="text-container"> <h2><?php echo $title; ?> </h2> <p><?php echo $abstract; ?> </p> </div> </a> <!-- End Featured Box Panel --> </li> <?php $url = $jasFeaturedStories_options['story3_link' . $pub]; $postId = url_to_postid($url); $post = get_post($postId); $title = stripslashes(stripslashes($jasFeaturedStories_options['story3_headline' . $pub])); if (strlen($title) == 0) { $title = $post->post_title; } $abstract = stripslashes(stripslashes($jasFeaturedStories_options['story3_abstract' . $pub])); $size = '&w=214&h=120'; if ($jasFeaturedStories_options['story3_primary'] == true) { $class = 'primary'; $size = '&w=428&h=241'; if (!$prim) { $class = 'primary current'; $prim = true; } } elseif (!$sec) { $class = 'secondary'; $sec = true; } else { $class = 'tertiary'; $tert = true; } $imagesrc = ''; if (strlen($jasFeaturedStories_options['story3_imageUrl']) > 0) { $imagesrc = $jasFeaturedStories_options['story3_imageUrl']; } else { if (function_exists('catch_that_image')) { $imagesrc = catch_that_image($post); } } ?> <li class="<?php echo $class; ?> " id="story3"> <a class="panel" href="<?php echo $url; ?> " style="background-image:url('<?php bloginfo('template_directory'); ?> /timthumb/timthumb.php?src=<?php echo $imagesrc . $size; ?> &zc=1');"> <div class="text-container"> <h2><?php echo $title; ?> </h2> <p><?php echo $abstract; ?> </p> </div> </a> <!-- End Featured Box Panel --> </li> <?php $url = $jasFeaturedStories_options['story4_link' . $pub]; $postId = url_to_postid($url); $post = get_post($postId); $title = stripslashes(stripslashes($jasFeaturedStories_options['story4_headline' . $pub])); if (strlen($title) == 0) { $title = $post->post_title; } $abstract = stripslashes(stripslashes($jasFeaturedStories_options['story4_abstract' . $pub])); $size = '&w=214&h=120'; if ($jasFeaturedStories_options['story4_primary'] == true) { $class = 'primary'; $size = '&w=428&h=241'; if (!$prim) { $class = 'primary current'; $prim = true; } } elseif (!$sec) { $class = 'secondary'; $sec = true; } else { $class = 'tertiary'; $tert = true; } $imagesrc = ''; if (strlen($jasFeaturedStories_options['story4_imageUrl']) > 0) { $imagesrc = $jasFeaturedStories_options['story4_imageUrl']; } else { if (function_exists('catch_that_image')) { $imagesrc = catch_that_image($post); } } ?> <li class="<?php echo $class; ?> " id="story4"> <a class="panel" href="<?php echo $url; ?> " style="background-image:url('<?php bloginfo('template_directory'); ?> /timthumb/timthumb.php?src=<?php echo $imagesrc . $size; ?> &zc=1');"> <div class="text-container"> <h2><?php echo $title; ?> </h2> <p><?php echo $abstract; ?> </p> </div> </a> <!-- End Featured Box Panel --> </li> <?php $url = $jasFeaturedStories_options['story5_link' . $pub]; $postId = url_to_postid($url); $post = get_post($postId); $title = stripslashes(stripslashes($jasFeaturedStories_options['story5_headline' . $pub])); if (strlen($title) == 0) { $title = $post->post_title; } $abstract = stripslashes(stripslashes($jasFeaturedStories_options['story5_abstract' . $pub])); $size = '&w=214&h=120'; if ($jasFeaturedStories_options['story5_primary'] == true) { $class = 'primary'; $size = '&w=428&h=241'; if (!$prim) { $class = 'primary current'; $prim = true; } } elseif (!$sec) { $class = 'secondary'; $sec = true; } else { $class = 'tertiary'; $tert = true; } $imagesrc = ''; if (strlen($jasFeaturedStories_options['story5_imageUrl']) > 0) { $imagesrc = $jasFeaturedStories_options['story5_imageUrl']; } else { if (function_exists('catch_that_image')) { $imagesrc = catch_that_image($post); } } ?> <li class="<?php echo $class; ?> " id="story5"> <a class="panel" href="<?php echo $url; ?> " style="background-image:url('<?php bloginfo('template_directory'); ?> /timthumb/timthumb.php?src=<?php echo $imagesrc . $size; ?> &zc=1');"> <div class="text-container"> <h2><?php echo $title; ?> </h2> <p><?php echo $abstract; ?> </p> </div> </a> <!-- End Featured Box Panel --> </li> </ul> </div> <?php }
$sl++; ?> <div id="home_cat<?php echo $sl; ?> " class="home_other_cats left"> <div class="home_cat_title"><h2><?php echo $bname; ?> </h2></div> <?php foreach ($pages[$bid] as $post) { ?> <?php $post_content_old = $post->post_content; $post_image = catch_that_image($post_content_old); echo '<img src="' . $post_image . '" />'; ?> <h3 class="home_other_post_title left"><a href="<?php echo $post->guid; ?> "> <?php echo $post->post_title; ?> »</a></h3> <div class="home_post_wrapper left"> <p class="cat_other_posts"> <?php $post_content = strip_tags($post_content_old); if (strlen($post_content) <= 350) {
<span class="ribbon ribbon_<?php if (strtotime($post->post_date_gmt) == strtotime($post->post_modified_gmt)) { echo 'new'; } else { echo 'update'; } ?> "></span> <span class="shadown"><img alt="<?php the_title(); ?> " src="<?php bloginfo('home'); ?> /media/resizer/64x64/r/<?php echo remove_http(catch_that_image($post)); ?> "></span> <span class="comment"><a href="<?php the_permalink(); ?> " title="<?php the_title(); ?> "> <?php if (in_category('1')) { $url = get_the_title(); echo '<strong>' . $url . '</strong>'; } else { $url = get_the_title();
<div class="col-lg"><h2>WSBF BLOG</h2></div> <div class="col-lg blog-content"> <div id="ca-container" class="ca-container"> <div class="ca-wrapper"> <?php $posts = get_posts('numberposts=9&order=DESC&orderby=date'); foreach ($posts as $post) { setup_postdata($post); ?> <div class="ca-item ca-item-1"> <div class="ca-item-main"> <?php $image_catch = catch_that_image($post); if (get_the_post_thumbnail() != '' || $image_catch != '') { ?> <div class="ca-icon"> <?php if (get_the_post_thumbnail() != '') { echo '<a href="showpost.php?p=' . get_the_ID() . '" class="thumbnail-wrapper">'; the_post_thumbnail(); echo '</a>'; } else { if ($image_catch != '') { echo '<a href="showpost.php?p=' . get_the_ID() . '" class="thumbnail-wrapper">'; echo '<img src="'; echo $image_catch; echo '" alt="" />'; echo '</a>'; } }
function tabs_latest($posts = 5, $size = 35) { $the_query = new WP_Query('showposts=' . $posts . '&orderby=post_date&order=desc'); while ($the_query->have_posts()) { $the_query->the_post(); ?> <li> <?php $cti = catch_that_image(); if (isset($cti)) { ?> <span class="popular-image"><img src="<?php bloginfo('template_url'); ?> /thumb.php?src=<?php echo $cti; ?> &h=40&w=40&zc=1"/></span> <?php } ?> <a title="<?php the_title(); ?> " href="<?php the_permalink(); ?> "><?php the_title(); ?> </a> <span class="meta"><?php the_time(__('jS F, Y', 'default')); ?> </span> <div class="fix"></div> </li> <?php } }
function make_contents($content) { global $_mc_contain, $left_adw_contents, $right_adw_contents, $auto_insert_contents, $noindex_contents, $min_amount_title_contents, $content_title_type; if ($auto_insert_contents == 1 or $auto_insert_contents == 2) { if (!is_singular()) { return $content; } } else { if (!is_singular() || strpos($content, '[contents') === false) { return $content; } } $_mc_contain = array(); // получаем данные о содержании if ($auto_insert_contents == 1 or $auto_insert_contents == 2) { $content_morkovin = "[contents {$content_title_type}]" . $content; preg_match('~\\[contents\\s*([^\\]]*)\\](.*)~s', $content_morkovin, $m); } else { preg_match('~\\[contents\\s*([^\\]]*)\\](.*)~s', $content, $m); } $hds = $m[1] ? trim($m[1]) : 'h2'; $hds = explode(' ', $hds); $hds = array_map('trim', $hds); $h = implode('|', $hds); // заменяем заголовки в контенте на ссылки к меню $_content = $m[2]; // считаем общее количество preg_match_all('@</(' . $h . ')>@i', $_content, $n); $_mc_contain['all'] = count($n[0]); $_content = preg_replace_callback('@<(?:' . $h . ')[^>]*>(.*?)</(' . $h . ')>@is', '_make_contents', $_content); // вставляем содержание if (!is_front_page() and !is_page() and $_mc_contain['contents']) { $contents = implode("", $_mc_contain['contents']); } if ($auto_insert_contents == 1 or $auto_insert_contents == 2) { $_content1 = ""; } else { $_content1 = $_content; } $out = ''; if ($left_adw_contents != "" and $right_adw_contents != "" and $_mc_contain['contents']) { $out = '<!--noindex--><div class="table-of-content"><div class="table-of-content__title">Содержание</div>'; $out .= "\n<ul id='с_menu' class='contents'>\n" . $contents . "</ul>\n</div><!--/noindex-->" . $_content1; } elseif ($left_adw_contents != "" and $_mc_contain['contents']) { $out = '<div class="contents-block"><div class="left-adw-contents-block">' . $left_adw_contents . '</div>'; $out .= '<!--noindex--><div class="table-of-content content-right"><div class="table-of-content__title">Содержание</div>'; $out .= "\n<ul id='с_menu' class='contents'>\n" . $contents . "</ul>\n</div><!--/noindex--></div><!--.contents-block-->" . $_content1; } elseif ($right_adw_contents != "" and $_mc_contain['contents']) { $out = '<div class="contents-block"><!--noindex--><div class="table-of-content content-left"><div class="table-of-content__title">Содержание</div>'; $out .= "\n<ul id='с_menu' class='contents'>\n" . $contents . "</ul>\n</div><!--/noindex-->"; $out .= '<div class="right-adw-contents-block">' . $right_adw_contents . '</div></div><!--.contents-block-->' . $_content1; } elseif ($_mc_contain['contents']) { $out = '<!--noindex--><div class="table-of-content"><div class="table-of-content__title">Содержание</div>'; $out .= "\n<ul id='с_menu' class='contents'>\n" . $contents . "</ul>\n</div><!--/noindex-->" . $_content1; } if ($auto_insert_contents == 1 and is_single() and $_mc_contain['all'] >= $min_amount_title_contents) { $first_img_url = catch_that_image(); $alt_img = get_the_title(); $condition = '/<img.*? src=\\"' . preg_quote($first_img_url, "/") . '\\"[^>]*>/i'; $replace = '<div class="first-single-img"><img src="' . $first_img_url . '" alt="' . $alt_img . '"></div>' . $out; $content = preg_replace($condition, $replace, $_content); } elseif ($auto_insert_contents == 2 and is_single() and $_mc_contain['all'] >= $min_amount_title_contents) { $content = $out . $_content; } else { $content = str_replace($m[0], $out, $content); } unset($_mc_contain); return $content; }
<li><!-- POSTMORE --><a class="topic-tag-link ttl1" href="<?php echo $feed['link']; ?> " target="_blank">Original Story</a><!-- POSTMORE --></li> <li><a class="topic-tag-link ttl2" href="/feed-information/<?php echo $feed['id']; ?> /">Feed information</a></li> </ul> <?php //the closing div is in thumbsup the_content hook function ?> <?php $content = get_the_content(); $image_link = catch_that_image($content); echo "<div style='display: none;'><!-- POSTIMAGE -->" . $image_link . "<!-- POSTIMAGE --></div>"; ?> <div style="display: none;"> <!-- POSTCONTENT --> <?php echo $content; ?> <!-- POSTCONTENT --> </div> <?php the_content(); ?> <div style="text-align: center; padding-top: 10px;"><a href="<?php echo $feed['link']; ?>
?> " /> </a> </figure> <?php } } } } } else { //NOT A FEATURED POST - use a small image //USE A FEATURED IMAGE IF ONE EXISTS //echo 'not a featured post'; $postimageurl = get_post_meta($post->ID, 'post-img', true); //DOES IT HAVE A TN? $img_path = catch_that_image(); if (has_post_thumbnail()) { //echo 'has a thumbnail, use that'; ?> <figure class="post-img-medium"> <a href="<?php the_permalink(); ?> " class="the-display" rel="bookmark"> <?php the_post_thumbnail('category-medium'); ?> </a> </figure> <?php
?> " class="maps-title"><a href="<?php the_permalink(); ?> "><?php echo $title; ?> </a></h3> <div class="post" id="post-<?php the_ID(); ?> "> <div class="thumbnail"> <img src="<?php echo catch_that_image(get_the_content()); ?> " style="width:80px; margin:-5px; float:none;" /> </div> <?php the_excerpt(); ?> <?php echo get_post_meta($post->ID, "location", 'true'); ?> <?php list($lat, $lng) = explode(',', get_post_meta($post->ID, "latlng", 'true')); echo "Lat: {$lat} and Long: {$lng}"; ?> <script type="text/javascript">
$rss = fetch_feed(get_site_url() . '/berea-spotlight/home-page/feed/'); if (!is_wp_error($rss)) { $maxitems = $rss->get_item_quantity(1); $rss_items = $rss->get_items(0, $maxitems); } ?> <?php if ($maxitems == 0) { echo '<li>No news at this item.</li>'; } else { // Loop through each feed item and display each item as a hyperlink. foreach ($rss_items as $item) { ?> <div class="picture"> <?php $image = catch_that_image($item); ?> <img src="<?php echo $image; ?> " width="130" alt=""></div> <a href="<?php echo $item->get_permalink(); ?> " title="<?php echo 'Posted ' . $item->get_date('j F Y | g:i a'); ?> " style="float:"> <h3><?php echo $item->get_title();
<?php if (get_post_meta($post->ID, 'thumbnail', true)) { echo "<div class='thumbnail_t'>"; $image = get_post_meta($post->ID, 'thumbnail', true); echo "<a href='" . get_permalink() . "' rel='bookmark' title='" . get_the_title() . "'><img src='" . $image . "' alt='" . get_the_title() . "'/></a></div>"; } else { echo "<div class='thumbnail'>"; echo "<a href='" . get_permalink() . "' rel='bookmark' title='" . get_the_title() . "'>"; if (has_post_thumbnail()) { the_post_thumbnail('thumbnail'); } else { echo "<img src='" . catch_that_image() . "' alt='" . get_the_title() . "'/>"; } echo "</a></div>"; }
$twitter_user = "******"; } if ($lang == "de") { $tw_domain = "de"; } $postID = get_the_ID(); $title = translate_title(get_the_title($postID)); $post_object = get_post($postID); $content = substr(sanitize_text_field($post_object->post_content), 0, 250); $content = str_replace("\"", "", $content); $content = strip_shortcodes($content); //$content = get_the_content ( $postID ); $thumb = wp_get_attachment_url(get_post_thumbnail_id($postID)); //echo "L: $lang"; //echo "R: $region"; $twitter_image = "/" . catch_that_image(); //echo "IMG: ".$twitter_image; $twitter_image = str_replace("-130x130", "", $twitter_image); $twitter_image = str_replace("http://www.linux-hardware-guide.de", "", $twitter_image); $twitter_image = str_replace("http://www.linux-hardware-guide.com", "", $twitter_image); $twitter_image = str_replace("/images/default.jpg", "", $twitter_image); $twitter_image = str_replace("//", "/", $twitter_image); //check if file exists $upload_dir = wp_upload_dir(); $testfile = $upload_dir['basedir'] . str_replace("wp-uploads", "", $twitter_image); $testfile = str_replace("//", "/", $testfile); //echo "TEST: $testfile"; if (!file_exists($testfile)) { $twitter_image = ""; } //echo "II: ".$upload_dir['basedir'].$twitter_image;
setup_postdata($post); ?> <div class="blog-item my-col n-2-5"> <div class="blog-box"> <figure class="rollover"> <?php if (get_the_post_thumbnail() != '') { echo '<a href="showpost.php?p=' . get_the_ID() . '" class="thumbnail-wrapper">'; the_post_thumbnail(); echo '</a>'; } else { if (catch_that_image($post) != '') { echo '<a href="showpost.php?p=' . get_the_ID() . '" class="thumbnail-wrapper">'; echo '<img src="'; echo catch_that_image($post); echo '" alt="" />'; echo '</a>'; } } ?> </figure> <div class="info"> <h3 class="blog-title"> <?php echo '<a href="showpost.php?p=' . get_the_ID() . '">'; the_title(); echo '</a>'; ?> </h3> <div class="category">
?> "> <?php the_title(); ?> </a></h2> <?php } ?> <div style="clear: both;"></div> <?php $thumb = get_post_meta($post->ID, 'Thumbnail', $single = true); ?> <?php if ($thumb == '' && $puretype_grab_image == 'on') { $thumb = catch_that_image(); } ?> <?php if ($thumb !== '') { ?> <div class="thumbnail-div"> <a href="<?php the_permalink(); ?> " title="Permanent Link to <?php the_title(); ?> "><img src="<?php bloginfo('stylesheet_directory'); ?> /timthumb.php?src=<?php
$my_query = new WP_Query("showposts={$coldstone_featured_number}&cat={$feat_cat}&order=DESC"); while ($my_query->have_posts()) { $my_query->the_post(); $do_not_duplicate = $post->ID; $loopcounter++; ?> <div id="tab<?php echo $loopcounter; ?> "> <?php $image = get_post_meta($post->ID, 'Featured', $single = true); ?> <?php if ($image == '' && $coldstone_grab_image == 'on') { $image = catch_that_image(); } ?> <div class="moduletable"> <div class="feature_slide"> <img src="<?php bloginfo('stylesheet_directory'); ?> /timthumb.php?src=<?php echo $image; ?> &h=250&w=883&zc=1&q=100" class="featured_thumbnail" alt="<?php the_title(); ?> " /> <?php include TEMPLATEPATH . '/includes/featurednav-' . $coldstone_featured_number . '.php';
for ($i = 1; $i <= $featuredPosts; $i++) { // start for() loop while ($featuredPosts->have_posts()) { $featuredPosts->the_post(); // loop for posts titles ?> <h3>Latest News</h3> <h2 class="featured-title"><?php the_title(); ?> </h2> <?php if (catch_that_image() != "/images/default.jpg") { ?> <p><img src="<?php echo catch_that_image(); ?> " alt="<?php the_title(); ?> "></p> <?php } ?> <p><?php the_excerpt(); ?> </p> <div class="latest-read-more"><a href="<?php the_permalink(); ?>
global $post, $posts; $first_img = ''; ob_start(); ob_end_clean(); $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches); $first_img = $matches[1][0]; if (empty($first_img)) { $first_img = ""; } return $first_img; } if (is_single() || is_page()) { $twitter_url = get_permalink(); $twitter_title = get_the_title(); $twitter_desc = get_the_content(); $twitter_thumb = catch_that_image(); $twitter_name = 'justmarkup'; ?> <meta name="twitter:card" value="summary" /> <meta name="twitter:url" value="<?php echo $twitter_url; ?> " /> <meta name="twitter:title" value="<?php echo $twitter_title; ?> " /> <meta name="twitter:description" value="<?php echo $twitter_desc; ?> " />