本文整理汇总了PHP中genesis_get_image函数的典型用法代码示例。如果您正苦于以下问题:PHP genesis_get_image函数的具体用法?PHP genesis_get_image怎么用?PHP genesis_get_image使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了genesis_get_image函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: 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;
extract($args);
//* Merge with defaults
$instance = wp_parse_args((array) $instance, $this->defaults);
echo $before_widget;
//* Set up the author bio
if (!empty($instance['title'])) {
echo $before_title . apply_filters('widget_title', $instance['title'], $instance, $this->id_base) . $after_title;
}
$wp_query = new WP_Query(array('page_id' => $instance['page_id']));
if (have_posts()) {
while (have_posts()) {
the_post();
genesis_markup(array('html5' => '<article %s>', 'xhtml' => sprintf('<div class="%s">', implode(' ', get_post_class())), 'context' => 'entry'));
$image = genesis_get_image(array('format' => 'html', 'size' => $instance['image_size'], 'context' => 'featured-page-widget', 'attr' => genesis_parse_attr('entry-image-widget')));
if ($instance['show_image'] && $image) {
printf('<a href="%s" title="%s" class="%s">%s</a>', get_permalink(), the_title_attribute('echo=0'), esc_attr($instance['image_alignment']), $image);
}
if (!empty($instance['show_title'])) {
if (genesis_html5()) {
printf('<header class="entry-header"><h2 class="entry-title"><a href="%s" title="%s">%s</a></h2></header>', get_permalink(), the_title_attribute('echo=0'), get_the_title());
} else {
printf('<h2><a href="%s" title="%s">%s</a></h2>', get_permalink(), the_title_attribute('echo=0'), get_the_title());
}
}
if (!empty($instance['show_content'])) {
echo genesis_html5() ? '<div class="entry-content">' : '';
if (empty($instance['content_limit'])) {
global $more;
$more = 0;
the_content($instance['more_text']);
} else {
the_content_limit((int) $instance['content_limit'], esc_html($instance['more_text']));
}
echo genesis_html5() ? '</div>' : '';
}
if (!empty($instance['custom_text'])) {
$text = wp_kses_post($instance['custom_text']);
echo '<div class="custom-text">';
echo $instance['filter'] ? wpautop($text) : $text;
if (!empty($instance['more_text'])) {
echo '<span class="more-link"><a href="' . get_permalink($instance['page_id']) . '">' . $instance['more_text'] . '</a></span>';
}
echo '</div>';
}
genesis_markup(array('html5' => '</article>', 'xhtml' => '</div>'));
}
}
//* Restore original query
wp_reset_query();
echo $after_widget;
}
开发者ID:Bobcatou,项目名称:enhanceworldwide,代码行数:62,代码来源:wsm-featured-page.php
示例17: 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
示例18: widget
/**
* Outputs the content of the widget
*
* @param array $args
* @param array $instance
*/
public function widget($args, $instance)
{
switch ($instance['style']) {
case "style1":
wp_enqueue_style('badabing_team', BADABING_ESSENTIALS_URL . 'widgets/badabing.team.css', false, '1.0.0', 'screen');
wp_enqueue_script('badabing_teamjs', BADABING_ESSENTIALS_URL . 'widgets/badabing.team.js', array('jquery'), '1.0.0');
break;
case "style2":
break;
}
global $wp_query;
// outputs the content of the widget
echo $args['before_widget'];
$args = array('post_type' => 'post', 'cat' => $instance['posts_cat'], 'showposts' => $instance['posts_num'], 'offset' => $instance['posts_offset'], 'orderby' => $instance['orderby'], 'order' => $instance['order']);
$wp_query = new WP_query($args);
if (have_posts()) {
$picnum = 1;
while (have_posts()) {
the_post();
$image = genesis_get_image(array('format' => 'url', 'size' => $instance['image_size'], 'fallback' => array('url' => $instance['fallbackurl'])));
$the_pictures .= sprintf(' <li class="quote%s"><a href="%s"><img src="%s" alt="%s"></a></li>', $picnum, 'javascript:void();', $image, get_the_title());
if ($instance['show_quotes']) {
$the_quotes .= sprintf(' <li class="quote%s"><p>%s</p></li>', $picnum, get_the_content());
}
$picnum++;
}
echo '<div class="testimonials">';
printf(' <h3>%s</h3>', $instance['title']);
echo ' <div class="container">';
echo ' <div class="photos">';
echo ' <ul class="clearfix">';
echo $the_pictures;
echo ' </ul>';
echo ' <div class="author"></div>';
// leave empty, this will be filled using jquery
echo ' </div>';
if ($instance['show_quotes']) {
echo ' <div class="quotes">';
echo ' <ul>';
echo $the_quotes;
echo ' </ul>';
echo ' </div>';
}
echo ' <div style="clear:both;"></div>';
echo ' </div>';
echo '</div>';
} else {
printf('<!-- %s -->', __('Nothing to see here', 'bbessentials'));
}
wp_reset_query();
echo $args['after_widget'];
}
开发者ID:badabingbreda,项目名称:badabing-essentials,代码行数:58,代码来源:badabing.team.php
示例19: widget
/**
* Echo the widget content.
*
* @since 0.2.0
*
* @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;
extract($args);
//* Merge with defaults
$instance = wp_parse_args((array) $instance, $this->defaults);
echo $before_widget;
//* Set up the widget title
if (!empty($instance['title'])) {
echo '<h2 class="widget-title widgettitle">' . apply_filters('widget_title', $instance['title'], $instance, $this->id_base) . '</h2>';
}
$query_args = array('post_type' => 'awp-community', 'showposts' => $instance['posts_num'], 'offset' => $instance['posts_offset'], 'orderby' => $instance['orderby'], 'order' => $instance['order']);
$wp_query = new WP_Query($query_args);
if (have_posts()) {
while (have_posts()) {
the_post();
genesis_markup(array('html5' => '<article %s>', 'xhtml' => sprintf('<div class="%s">', implode(' ', get_post_class())), 'context' => 'entry'));
$image = genesis_get_image(array('format' => 'html', 'size' => $instance['image_size'], 'context' => 'featured-community-widget', 'attr' => genesis_parse_attr('entry-image-widget')));
if ($instance['show_image'] && $image) {
printf('<div class="awp-community-image"><a href="%s" title="%s" class="%s">%s</a></div>', get_permalink(), the_title_attribute('echo=0'), 'awp-community-link', $image);
}
if ($instance['show_title']) {
echo '<header class="entry-header">';
printf('<h3 class="entry-title"><a href="%s" title="%s">%s</a></h3>', get_permalink(), the_title_attribute('echo=0'), get_the_title());
echo '</header>';
}
if (!empty($instance['show_content'])) {
echo '<div class="entry-content">';
if ('excerpt' == $instance['show_content']) {
$current_excerpt = get_the_excerpt();
echo $current_excerpt;
//the_excerpt();
} elseif ('content-limit' == $instance['show_content']) {
the_content_limit((int) $instance['content_limit'], esc_html($instance['more_text']));
} else {
global $more;
$orig_more = $more;
$more = 0;
the_content(esc_html($instance['more_text']));
$more = $orig_more;
}
echo '</div>';
}
genesis_markup(array('html5' => '</article>', 'xhtml' => '</div>'));
}
}
//* Restore original query
wp_reset_query();
echo $after_widget;
}
开发者ID:jdelia,项目名称:genesis-communities-cpt,代码行数:58,代码来源:featured-awp-communities-widget.php
示例20: agentpress_featured_listings_widget_loop_filter
/**
* Filter the loop output of the AgentPress Featured Listings Widget.
*
*/
function agentpress_featured_listings_widget_loop_filter($loop)
{
$loop = '';
/** initialze the $loop variable */
$loop .= sprintf('<a href="%s">%s</a>', get_permalink(), genesis_get_image(array('size' => 'properties')));
$loop .= sprintf('<span class="listing-price">%s</span>', genesis_get_custom_field('_listing_price'));
$custom_text = genesis_get_custom_field('_listing_text');
if (strlen($custom_text)) {
$loop .= sprintf('<span class="listing-text">%s</span>', esc_html($custom_text));
}
$loop .= sprintf('<span class="listing-address">%s</span>', genesis_get_custom_field('_listing_address'));
$loop .= sprintf('<span class="listing-city-state-zip">%s %s, %s</span>', genesis_get_custom_field('_listing_city'), genesis_get_custom_field('_listing_state'), genesis_get_custom_field('_listing_zip'));
$loop .= sprintf('<a href="%s" class="more-link">%s</a>', get_permalink(), __('View Listing', 'apl'));
return $loop;
}
开发者ID:kabrewer07,项目名称:mrw,代码行数:19,代码来源:functions.php
注:本文中的genesis_get_image函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论