当前位置: 首页>>代码示例>>PHP>>正文


PHP genesis_get_image函数代码示例

本文整理汇总了PHP中genesis_get_image函数的典型用法代码示例。如果您正苦于以下问题:PHP genesis_get_image函数的具体用法?PHP genesis_get_image怎么用?PHP genesis_get_image使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了genesis_get_image函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: genesis_do_post_image

function genesis_do_post_image()
{
    if (!is_singular() && genesis_get_option('content_archive_thumbnail')) {
        $img = genesis_get_image(array('format' => 'html', 'size' => genesis_get_option('image_size'), 'attr' => array('class' => 'alignleft post-image')));
        printf('<a href="%s" title="%s">%s</a>', get_permalink(), the_title_attribute('echo=0'), $img);
    }
}
开发者ID:Weissenberger13,项目名称:web.portugalrentalcottages,代码行数:7,代码来源:post.php

示例2: sk_image

function sk_image()
{
    $image_args = array('size' => 'masonry-thumb');
    // Get the featured image HTML
    $image = genesis_get_image($image_args);
    echo '<a rel="bookmark" href="' . get_permalink() . '">' . $image . '</a>';
}
开发者ID:ngo6012,项目名称:socratic-genesis-starter-theme,代码行数:7,代码来源:page-masonry.php

示例3: post_format_image_featured

function post_format_image_featured()
{
    if (has_post_format('image') && has_post_thumbnail() && is_singular('post')) {
        $img = genesis_get_image(array('format' => 'html', 'size' => genesis_get_option('image_size'), 'attr' => array('class' => 'post-image')));
        printf('<a href="%s" id="featured-post-image" title="%s">%s</a>', get_permalink(), the_title_attribute('echo=0'), $img);
    }
}
开发者ID:MarioGiancini,项目名称:thedbz-theme,代码行数:7,代码来源:functions.php

示例4: rmb_add_image

/**
 * Output the image
 * We're only going to link the image if there's something to link to
 */
function rmb_add_image()
{
    $imageclass = 'alignright member-single-image';
    if ($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'));
    }
}
开发者ID:redblueconcepts,项目名称:redblue-members,代码行数:11,代码来源:single-member.php

示例5: widget

 /**
  * Echo the widget content.
  *
  * @since 0.1.8
  *
  * @param array $args Display arguments including before_title, after_title, before_widget, and after_widget.
  * @param array $instance The settings for the particular instance of the widget
  */
 function widget($args, $instance)
 {
     global $wp_query, $_genesis_displayed_ids;
     extract($args);
     // Merge with defaults
     $instance = wp_parse_args((array) $instance, $this->defaults);
     echo $before_widget;
     if (!empty($instance['title'])) {
         echo $before_title . apply_filters('widget_title', $instance['title'], $instance, $this->id_base) . $after_title;
     }
     $query_args = array('post_type' => 'listing', 'taxonomy' => $instance['taxonomy'], 'showposts' => $instance['posts_num'], 'offset' => $instance['posts_offset'], 'orderby' => $instance['orderby'], 'order' => $instance['order']);
     // Exclude displayed IDs from this loop?
     global $post;
     $wp_query = new WP_Query($query_args);
     if (have_posts()) {
         while (have_posts()) {
             the_post();
             $_genesis_displayed_ids[] = get_the_ID();
             genesis_markup(array('html5' => '<article %s><div class="listing-wrap">', 'xhtml' => sprintf('<div class="%s"><div class="listing-wrap">', implode(' ', get_post_class())), 'context' => 'entry'));
             $image = genesis_get_image(array('format' => 'html', 'size' => $instance['image_size'], 'context' => 'featured-post-widget', 'attr' => genesis_parse_attr('entry-image-widget')));
             if ($instance['show_image']) {
                 if ($image) {
                     printf('<a href="%s" alt="%s">%s</a>', esc_url(get_permalink()), esc_attr(the_title_attribute('echo=0')), wp_kses_post($image));
                 } else {
                     $fallback = plugins_url('includes/sample-images/simple-listings.png', dirname(__FILE__));
                     printf('<a href="%s"><img src="%s" alt="%s" />', esc_url(get_permalink()), esc_url($fallback), esc_attr(the_title_attribute('echo=0')));
                 }
             }
             if ($instance['show_title']) {
                 echo genesis_html5() ? '<header class="entry-header">' : '';
             }
             if (!empty($instance['show_title'])) {
                 printf('<h2 class="entry-title">%s</h2>', the_title_attribute('echo=0'), get_the_title());
             }
             if (!empty($instance['show_status'])) {
                 echo '<span class="listing-status">' . strip_tags(get_the_term_list($post->ID, 'status', '', ', ', '')) . '</span>';
             }
             if ($instance['show_title']) {
                 echo genesis_html5() ? '</header>' : '';
             }
             if (!empty($instance['show_content'])) {
                 echo genesis_html5() ? '<div class="entry-content">' : '';
                 global $more;
                 $orig_more = $more;
                 $more = 0;
                 the_content(esc_html($instance['more_text']));
                 $more = $orig_more;
                 echo genesis_html5() ? '</div>' : '';
             }
             genesis_markup(array('html5' => '</div></article>', 'xhtml' => '</div></div>'));
         }
     }
     if (!empty($instance['archive_link']) && !empty($instance['archive_text'])) {
         printf('<p class="more-from-category"><a href="%1$s">%2$s</a></p>', esc_url(get_post_type_archive_link($instance['post_type'])), esc_html($instance['archive_text']));
     }
     // Restore original query
     wp_reset_query();
     echo $after_widget;
 }
开发者ID:christophherr,项目名称:simple-listings-genesis,代码行数:67,代码来源:featured-listing-widget.php

示例6: single_post_featured_image

function single_post_featured_image()
{
    if (!is_singular()) {
        return;
    }
    $img = genesis_get_image(array('format' => 'html', 'size' => genesis_get_option('image_size'), 'attr' => array('class' => 'post-image')));
    printf('<a href="%s" title="%s">%s</a>', get_permalink(), the_title_attribute('echo=0'), $img);
}
开发者ID:jonpetersen,项目名称:PHTC,代码行数:8,代码来源:functions.php

示例7: widget

 function widget($args, $instance)
 {
     /** defaults */
     $instance = wp_parse_args($instance, array('title' => '', 'posts_per_page' => 10));
     extract($args);
     echo $before_widget;
     if (!empty($instance['title'])) {
         echo $before_title . apply_filters('widget_title', $instance['title'], $instance, $this->id_base) . $after_title;
     }
     $toggle = '';
     /** for left/right class */
     $query_args = array('post_type' => 'listing', 'posts_per_page' => $instance['posts_per_page'], 'paged' => get_query_var('paged') ? get_query_var('paged') : 1);
     query_posts($query_args);
     if (have_posts()) {
         while (have_posts()) {
             the_post();
             //* initialze the $loop variable
             $loop = '';
             //* Pull all the listing information
             $custom_text = genesis_get_custom_field('_listing_text');
             $price = genesis_get_custom_field('_listing_price');
             $address = genesis_get_custom_field('_listing_address');
             $city = genesis_get_custom_field('_listing_city');
             $state = genesis_get_custom_field('_listing_state');
             $zip = genesis_get_custom_field('_listing_zip');
             $loop .= sprintf('<a href="%s">%s</a>', get_permalink(), genesis_get_image(array('size' => 'properties')));
             if ($price) {
                 $loop .= sprintf('<span class="listing-price">%s</span>', $price);
             }
             if (strlen($custom_text)) {
                 $loop .= sprintf('<span class="listing-text">%s</span>', esc_html($custom_text));
             }
             if ($address) {
                 $loop .= sprintf('<span class="listing-address">%s</span>', $address);
             }
             if ($city || $state || $zip) {
                 //* count number of completed fields
                 $pass = count(array_filter(array($city, $state, $zip)));
                 //* If only 1 field filled out, no comma
                 if (1 == $pass) {
                     $city_state_zip = $city . $state . $zip;
                 } elseif ($city) {
                     $city_state_zip = $city . ", " . $state . " " . $zip;
                 } else {
                     $city_state_zip = $city . " " . $state . ", " . $zip;
                 }
                 $loop .= sprintf('<span class="listing-city-state-zip">%s</span>', trim($city_state_zip));
             }
             $loop .= sprintf('<a href="%s" class="more-link">%s</a>', get_permalink(), __('View Listing', 'agentpress-listings'));
             $toggle = $toggle == 'left' ? 'right' : 'left';
             /** wrap in post class div, and output **/
             printf('<div class="%s"><div class="widget-wrap"><div class="listing-wrap">%s</div></div></div>', join(' ', get_post_class($toggle)), apply_filters('agentpress_featured_listings_widget_loop', $loop));
         }
     }
     wp_reset_query();
     echo $after_widget;
 }
开发者ID:kabrewer07,项目名称:mrw,代码行数:57,代码来源:class-featured-listings-widget.php

示例8: streamline_post_image

function streamline_post_image()
{
    if (is_page()) {
        return;
    }
    if ($image = genesis_get_image('format=url&size=post-image')) {
        printf('<a href="%s" rel="bookmark"><img class="post-photo" src="%s" alt="%s" /></a>', get_permalink(), $image, the_title_attribute('echo=0'));
    }
}
开发者ID:hscale,项目名称:webento,代码行数:9,代码来源:functions.php

示例9: genesis_image_do_entry_content

/**
 * Display the image
 * 
 * We know it's an image since the file is image.php
 */
function genesis_image_do_entry_content()
{
    $img = genesis_get_image(array('format' => 'html', 'size' => genesis_get_option('image_size'), 'context' => 'archive', 'attr' => genesis_parse_attr('entry-image')));
    if (!empty($img)) {
        echo $img;
    } else {
        //echo "Not got it yet";
    }
}
开发者ID:bobbingwide,项目名称:genesis-hm,代码行数:14,代码来源:image.php

示例10: generate_post_image

function generate_post_image()
{
    if (is_page() || !genesis_get_option('content_archive_thumbnail')) {
        return;
    }
    if ($image = genesis_get_image(array('format' => 'url', 'size' => genesis_get_option('image_size')))) {
        printf('<a href="%s" rel="bookmark"><img class="post-image" src="%s" alt="%s" /></a>', get_permalink(), $image, the_title_attribute('echo=0'));
    }
}
开发者ID:hscale,项目名称:webento,代码行数:9,代码来源:functions.php

示例11: genesis_image

/**
 * Pulls an image from media gallery
 * and echos it
 *
 * @since 0.1
 */
function genesis_image($args = array())
{
    $image = genesis_get_image($args);
    if ($image) {
        echo $image;
    } else {
        return FALSE;
    }
}
开发者ID:Weissenberger13,项目名称:web.portugalrentalcottages,代码行数:15,代码来源:image.php

示例12: wpbilbao_featured_photo

function wpbilbao_featured_photo()
{
    if (is_page() || !genesis_get_option('content_archive_thumbnail')) {
        return;
    }
    if ($image = genesis_get_image(array('format' => 'url', 'size' => genesis_get_option('image_size')))) {
        printf('<div class="featured-image"><img src="%s" alt="%s" class="entry-image"/></div>', $image, the_title_attribute('echo=0'));
    }
}
开发者ID:Sergiop79,项目名称:WPBilbao,代码行数:9,代码来源:theme_setup.php

示例13: genawpcomm_awp_community_grid

function genawpcomm_awp_community_grid()
{
    if ($image = genesis_get_image('format=url&size=awp-feature-community')) {
        printf('<div class="awp-community-image"><div class="community-featured-image"><a href="%s" rel="bookmark"><img src="%s" alt="%s" /></a></div>', get_permalink(), $image, the_title_attribute('echo=0'));
    }
    echo '<header class="entry-header">';
    printf('<h2 class="entry-title"><a href="%s" title="%s">%s</a></h2>', get_permalink(), the_title_attribute('echo=0'), get_the_title());
    echo '</header>';
}
开发者ID:jdelia,项目名称:genesis-communities-cpt,代码行数:9,代码来源:archive-awp-community.php

示例14: decor_post_image

function decor_post_image()
{
    if (is_page()) {
        return;
    }
    if ($image = genesis_get_image('format=url&size=post-image')) {
        printf('<a href="%s" rel="bookmark" class="post-photo"><div class="post-date">%s</div><img src="%s" alt="%s" /></a>', get_permalink(), do_shortcode('<em>[post_date format="j"]</em>[post_date format="F Y"]'), $image, the_title_attribute('echo=0'));
    }
}
开发者ID:hscale,项目名称:webento,代码行数:9,代码来源:functions.php

示例15: one_pager_display_posts_shortcode_output

function one_pager_display_posts_shortcode_output($output, $atts, $image, $title, $date, $excerpt, $inner_wrapper, $content, $class)
{
    $title = '<h3 itemprop="headline" class="entry-title">' . apply_filters('the_title', get_the_title()) . '</h3>';
    if ($atts['image_size']) {
        $image = '<div class="portfolio-image"><a rel="prettyPhoto[pp_gal]" href="' . genesis_get_image(array('format' => 'url')) . '">' . genesis_get_image(array('format' => 'html', 'size' => 'portfolio')) . '</a></div> ';
    } else {
        $image = '';
    }
    $output = '<' . $inner_wrapper . ' class="' . implode(' ', $class) . '">' . $title . $image . $date . $excerpt . $content . '</' . $inner_wrapper . '>';
    return $output;
}
开发者ID:brianjking,项目名称:one-pager-genesis,代码行数:11,代码来源:functions.php


注:本文中的genesis_get_image函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。