Diff
checker
텍스트
텍스트
이미지
문서
Excel
폴더
Legal
Enterprise
데스크톱
요금제
로그인
데스크톱 앱 다운로드
텍스트 비교
두 텍스트 파일의 차이점을 찾아보세요
도구
기록
실시간 편집
공백 변경 숨기기
변경 없는 행 숨기기
줄바꿈 비활성화
레이아웃
나란히 보기
합쳐 보기
비교 단위
스마트
단어
글자
텍스트 스타일
모양 변경
구문 강조
언어 선택
제외
텍스트 변환
첫 변경으로
수정
Diffchecker Desktop
가장 안전하게 Diffchecker를 사용하는 방법. 데스크톱 앱을 사용하면 비교 데이터가 외부로 전송되지 않습니다!
데스크톱 앱 받기
Untitled diff
생성일
10년 전
비교 결과 만료 없음
초기화
내보내기
공유
설명
23 삭제
행
총
삭제
글자
총
삭제
이 기능을 계속 사용하려면 업그레이드해 주세요
Diff
checker
Pro
요금제 보기
184 행
복사
104 추가
행
총
추가
글자
총
추가
이 기능을 계속 사용하려면 업그레이드해 주세요
Diff
checker
Pro
요금제 보기
245 행
복사
<?php
<?php
/**
/**
* Plugin Name
* Plugin Name
*
*
* @package Custom_Featured_Post_Widget
* @package Custom_Featured_Post_Widget
* @author Gary Jones
* @author Gary Jones
* @license GPL-2.0+
* @license GPL-2.0+
* @link http://gamajo.com/
* @link http://gamajo.com/
* @copyright 2013 Gary Jones, Gamajo Tech
* @copyright 2013 Gary Jones, Gamajo Tech
*/
*/
/**
/**
* Custom Featured Post widget class.
* Custom Featured Post widget class.
*
*
* @package Custom_Featured_Post_Widget
* @package Custom_Featured_Post_Widget
* @author Gary Jones
* @author Gary Jones
*/
*/
class Custom_Featured_Post extends Genesis_Featured_Post {
class Custom_Featured_Post extends Genesis_Featured_Post {
/**
/**
* Echo the widget content.
* Echo the widget content.
*
*
* @since 1.0.0
* @since 1.0.0
*
*
* @param array $args Display arguments including before_title, after_title, before_widget, and after_widget.
* @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
* @param array $instance The settings for the particular instance of the widget
*/
*/
function widget( $args, $instance ) {
function widget( $args, $instance ) {
global $wp_query, $_genesis_displayed_ids;
global $wp_query, $_genesis_displayed_ids;
복사
복사됨
복사
복사됨
extract( $args );
//* Merge with defaults
//* Merge with defaults
$instance = wp_parse_args( (array) $instance, $this->defaults );
$instance = wp_parse_args( (array) $instance, $this->defaults );
복사
복사됨
복사
복사됨
echo $
before_widget
;
echo $
args['
before_widget
']
;
//* Set up the author bio
//* Set up the author bio
if ( ! empty( $instance['title'] ) )
if ( ! empty( $instance['title'] ) )
복사
복사됨
복사
복사됨
echo $
before_title
. apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ) . $
after_title
;
echo $
args['
before_title
']
. apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ) . $
args['
after_title
']
;
$query_args = array(
$query_args = array(
복사
복사됨
복사
복사됨
'post_type'
=> 'post',
'post_type'
=> 'post',
'cat'
=> $instance['posts_cat'],
'cat'
=> $instance['posts_cat'],
'showposts'
=> $instance['posts_num'],
'showposts'
=> $instance['posts_num'],
'offset'
=> $instance['posts_offset'],
'offset'
=> $instance['posts_offset'],
'orderby'
=> $instance['orderby'],
'orderby'
=> $instance['orderby'],
'order'
=> $instance['order'],
'order'
=> $instance['order'],
'ignore_sticky_posts' => $instance['exclude_sticky'],
);
);
//* Exclude displayed IDs from this loop?
//* Exclude displayed IDs from this loop?
if ( $instance['exclude_displayed'] )
if ( $instance['exclude_displayed'] )
$query_args['post__not_in'] = (array) $_genesis_displayed_ids;
$query_args['post__not_in'] = (array) $_genesis_displayed_ids;
$wp_query = new WP_Query( $query_args );
$wp_query = new WP_Query( $query_args );
if ( have_posts() ) : while ( have_posts() ) : the_post();
if ( have_posts() ) : while ( have_posts() ) : the_post();
$_genesis_displayed_ids[] = get_the_ID();
$_genesis_displayed_ids[] = get_the_ID();
genesis_markup( array(
genesis_markup( array(
'html5' => '<article %s>',
'html5' => '<article %s>',
'xhtml' => sprintf( '<div class="%s">', implode( ' ', get_post_class() ) ),
'xhtml' => sprintf( '<div class="%s">', implode( ' ', get_post_class() ) ),
'context' => 'entry',
'context' => 'entry',
) );
) );
$image = genesis_get_image( array(
$image = genesis_get_image( array(
'format' => 'html',
'format' => 'html',
'size' => $instance['image_size'],
'size' => $instance['image_size'],
'context' => 'featured-post-widget',
'context' => 'featured-post-widget',
복사
복사됨
복사
복사됨
'attr' => genesis_parse_attr( 'entry-image-widget'
),
'attr' => genesis_parse_attr( 'entry-image-widget'
, array ( 'alt' => get_the_title() )
),
) );
) );
복사
복사됨
복사
복사됨
Text moved with changes from lines 93-101 (93.8% similarity)
if ( $instance['show_image'] && $image ) {
$role = empty( $instance['show_title'] ) ? '' : 'aria-hidden="true"';
printf( '<a href="%s" class="%s" %s>%s</a>', get_permalink(), esc_attr( $instance['image_alignment'] ), $role, $image );
}
if ( ! empty( $instance['show_gravatar'] ) ) {
echo '<span class="' . esc_attr( $instance['gravatar_alignment'] ) . '">';
echo get_avatar( get_the_author_meta( 'ID' ), $instance['gravatar_size'] );
echo '</span>';
}
if ( $instance['show_title'] )
if ( $instance['show_title'] )
echo genesis_html5() ? '<header class="entry-header">' : '';
echo genesis_html5() ? '<header class="entry-header">' : '';
if ( ! empty( $instance['show_title'] ) ) {
if ( ! empty( $instance['show_title'] ) ) {
복사
복사됨
복사
복사됨
$title = get_the_title() ? get_the_title() : __( '(no title)', 'genesis' );
/**
* Filter the featured post widget title.
*
* @since 2.2.0
*
* @param string $title Featured post title.
* @param array $instance {
* Widget settings for this instance.
*
* @type string $title Widget title.
* @type int $posts_cat ID of the post category.
* @type int $posts_num Number of posts to show.
* @type int $posts_offset Number of posts to skip when
* retrieving.
* @type string $orderby Field to order posts by.
* @type string $order ASC fr ascending order, DESC for
* descending order of posts.
* @type bool $exclude_displayed True if posts shown in main output
* should be excluded from this widget
* output.
* @type bool $show_image True if featured image should be
* shown, false otherwise.
* @type string $image_alignment Image alignment: alignnone,
* alignleft, aligncenter or alignright.
* @type string $image_size Name of the image size.
* @type bool $show_gravatar True if author avatar should be
* shown, false otherwise.
* @type string $gravatar_alignment Author avatar alignment: alignnone,
* alignleft or aligncenter.
* @type int $gravatar_size Dimension of the author avatar.
* @type bool $show_title True if featured page title should
* be shown, false otherwise.
* @type bool $show_byline True if post info should be shown,
* false otherwise.
* @type string $post_info Post info contents to show.
* @type bool $show_content True if featured page content
* should be shown, false otherwise.
* @type int $content_limit Amount of content to show, in
* characters.
* @type int $more_text Text to use for More link.
* @type int $extra_num Number of extra post titles to show.
* @type string $extra_title Heading for extra posts.
* @type bool $more_from_category True if showing category archive
* link, false otherwise.
* @type string $more_from_category_text Category archive link text.
* }
* @param array $args {
* Widget display arguments.
*
* @type string $before_widget Markup or content to display before the widget.
* @type string $before_title Markup or content to display before the widget title.
* @type string $after_title Markup or content to display after the widget title.
* @type string $after_widget Markup or content to display after the widget.
* }
*/
$title = apply_filters( 'genesis_featured_post_title', $title, $instance, $args );
$heading = genesis_a11y( 'headings' ) ? 'h4' : 'h2';
if ( genesis_html5() )
if ( genesis_html5() )
복사
복사됨
복사
복사됨
printf( '<
h2
class="entry-title"><a href="%s"
title="%s"
>%s</a></
h2>'
, get_permalink(),
the_
title
_attribute( 'echo=0' ), get_the_title()
);
printf( '<
%s
class="entry-title"><a href="%s"
>%s</a></
%s>', $heading
, get_permalink(),
$
title
, $heading
);
else
else
복사
복사됨
복사
복사됨
printf( '<
h2
><a href="%s"
title="%s"
>%s</a></
h2>'
, get_permalink(),
the_
title
_attribute( 'echo=0' ), get_the_title()
);
printf( '<
%s
><a href="%s"
>%s</a></
%s>', $heading
, get_permalink(),
$
title
, $heading
);
}
}
if ( ! empty( $instance['show_byline'] ) && ! empty( $instance['post_info'] ) )
if ( ! empty( $instance['show_byline'] ) && ! empty( $instance['post_info'] ) )
printf( genesis_html5() ? '<p class="entry-meta">%s</p>' : '<p class="byline post-info">%s</p>', do_shortcode( $instance['post_info'] ) );
printf( genesis_html5() ? '<p class="entry-meta">%s</p>' : '<p class="byline post-info">%s</p>', do_shortcode( $instance['post_info'] ) );
if ( $instance['show_title'] )
if ( $instance['show_title'] )
echo genesis_html5() ? '</header>' : '';
echo genesis_html5() ? '</header>' : '';
복사
복사됨
복사
복사됨
Text moved with changes to lines 74-84 (93.8% similarity)
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_gravatar'] ) ) {
echo '<span class="' . esc_attr( $instance['gravatar_alignment'] ) . '">';
echo get_avatar( get_the_author_meta( 'ID' ), $instance['gravatar_size'] );
echo '</span>';
}
if ( ! empty( $instance['show_content'] ) ) {
if ( ! empty( $instance['show_content'] ) ) {
echo genesis_html5() ? '<div class="entry-content">' : '';
echo genesis_html5() ? '<div class="entry-content">' : '';
if ( 'excerpt' == $instance['show_content'] ) {
if ( 'excerpt' == $instance['show_content'] ) {
the_excerpt();
the_excerpt();
}
}
elseif ( 'content-limit' == $instance['show_content'] ) {
elseif ( 'content-limit' == $instance['show_content'] ) {
복사
복사됨
복사
복사됨
the_content_limit( (int) $instance['content_limit'],
esc_html( $instance['more_text'] ) )
;
the_content_limit( (int) $instance['content_limit'],
genesis_a11y_more_link(
esc_html( $instance['more_text'] ) )
)
;
}
}
else {
else {
global $more;
global $more;
$orig_more = $more;
$orig_more = $more;
$more = 0;
$more = 0;
복사
복사됨
복사
복사됨
the_content(
esc_html( $instance['more_text'] ) )
;
the_content(
genesis_a11y_more_link(
esc_html( $instance['more_text'] ) )
)
;
$more = $orig_more;
$more = $orig_more;
}
}
echo genesis_html5() ? '</div>' : '';
echo genesis_html5() ? '</div>' : '';
}
}
genesis_markup( array(
genesis_markup( array(
'html5' => '</article>',
'html5' => '</article>',
'xhtml' => '</div>',
'xhtml' => '</div>',
) );
) );
endwhile; endif;
endwhile; endif;
//* Restore original query
//* Restore original query
wp_reset_query();
wp_reset_query();
//* The EXTRA Posts (list)
//* The EXTRA Posts (list)
if ( ! empty( $instance['extra_num'] ) ) {
if ( ! empty( $instance['extra_num'] ) ) {
if ( ! empty( $instance['extra_title'] ) )
if ( ! empty( $instance['extra_title'] ) )
복사
복사됨
복사
복사됨
echo $
before_title
. esc_html( $instance['extra_title'] ) . $
after_title
;
echo $
args['
before_title
']
. esc_html( $instance['extra_title'] ) . $
args['
after_title
']
;
$offset = intval( $instance['posts_num'] ) + intval( $instance['posts_offset'] );
$offset = intval( $instance['posts_num'] ) + intval( $instance['posts_offset'] );
$query_args = array(
$query_args = array(
'cat' => $instance['posts_cat'],
'cat' => $instance['posts_cat'],
'showposts' => $instance['extra_num'],
'showposts' => $instance['extra_num'],
'offset' => $offset,
'offset' => $offset,
);
);
$wp_query = new WP_Query( $query_args );
$wp_query = new WP_Query( $query_args );
$listitems = '';
$listitems = '';
if ( have_posts() ) {
if ( have_posts() ) {
while ( have_posts() ) {
while ( have_posts() ) {
the_post();
the_post();
$_genesis_displayed_ids[] = get_the_ID();
$_genesis_displayed_ids[] = get_the_ID();
복사
복사됨
복사
복사됨
$listitems .= sprintf( '<li><a href="%s"
title="%s"
>%s</a></li>', get_permalink()
, the_title_attribute( 'echo=0' )
, get_the_title() );
$listitems .= sprintf( '<li><a href="%s"
>%s</a></li>', get_permalink()
, get_the_title() );
}
}
if ( mb_strlen( $listitems ) > 0 )
if ( mb_strlen( $listitems ) > 0 )
printf( '<ul>%s</ul>', $listitems );
printf( '<ul>%s</ul>', $listitems );
}
}
//* Restore original query
//* Restore original query
wp_reset_query();
wp_reset_query();
}
}
if ( ! empty( $instance['more_from_category'] ) && ! empty( $instance['posts_cat'] ) )
if ( ! empty( $instance['more_from_category'] ) && ! empty( $instance['posts_cat'] ) )
printf(
printf(
'<p class="more-from-category"><a href="%1$s" title="%2$s">%3$s</a></p>',
'<p class="more-from-category"><a href="%1$s" title="%2$s">%3$s</a></p>',
esc_url( get_category_link( $instance['posts_cat'] ) ),
esc_url( get_category_link( $instance['posts_cat'] ) ),
esc_attr( get_cat_name( $instance['posts_cat'] ) ),
esc_attr( get_cat_name( $instance['posts_cat'] ) ),
esc_html( $instance['more_from_category_text'] )
esc_html( $instance['more_from_category_text'] )
);
);
복사
복사됨
복사
복사됨
echo $
after_widget
;
echo $
args['
after_widget
']
;
}
}
}
}
저장된 비교 결과
원본
파일 열기
<?php /** * Plugin Name * * @package Custom_Featured_Post_Widget * @author Gary Jones * @license GPL-2.0+ * @link http://gamajo.com/ * @copyright 2013 Gary Jones, Gamajo Tech */ /** * Custom Featured Post widget class. * * @package Custom_Featured_Post_Widget * @author Gary Jones */ class Custom_Featured_Post extends Genesis_Featured_Post { /** * Echo the widget content. * * @since 1.0.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, $_genesis_displayed_ids; 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; $query_args = array( 'post_type' => 'post', 'cat' => $instance['posts_cat'], 'showposts' => $instance['posts_num'], 'offset' => $instance['posts_offset'], 'orderby' => $instance['orderby'], 'order' => $instance['order'], ); //* Exclude displayed IDs from this loop? if ( $instance['exclude_displayed'] ) $query_args['post__not_in'] = (array) $_genesis_displayed_ids; $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>', 'xhtml' => sprintf( '<div class="%s">', 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_title'] ) echo genesis_html5() ? '<header class="entry-header">' : ''; if ( ! empty( $instance['show_title'] ) ) { if ( genesis_html5() ) printf( '<h2 class="entry-title"><a href="%s" title="%s">%s</a></h2>', 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_byline'] ) && ! empty( $instance['post_info'] ) ) printf( genesis_html5() ? '<p class="entry-meta">%s</p>' : '<p class="byline post-info">%s</p>', do_shortcode( $instance['post_info'] ) ); if ( $instance['show_title'] ) echo genesis_html5() ? '</header>' : ''; 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_gravatar'] ) ) { echo '<span class="' . esc_attr( $instance['gravatar_alignment'] ) . '">'; echo get_avatar( get_the_author_meta( 'ID' ), $instance['gravatar_size'] ); echo '</span>'; } if ( ! empty( $instance['show_content'] ) ) { echo genesis_html5() ? '<div class="entry-content">' : ''; if ( 'excerpt' == $instance['show_content'] ) { 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 genesis_html5() ? '</div>' : ''; } genesis_markup( array( 'html5' => '</article>', 'xhtml' => '</div>', ) ); endwhile; endif; //* Restore original query wp_reset_query(); //* The EXTRA Posts (list) if ( ! empty( $instance['extra_num'] ) ) { if ( ! empty( $instance['extra_title'] ) ) echo $before_title . esc_html( $instance['extra_title'] ) . $after_title; $offset = intval( $instance['posts_num'] ) + intval( $instance['posts_offset'] ); $query_args = array( 'cat' => $instance['posts_cat'], 'showposts' => $instance['extra_num'], 'offset' => $offset, ); $wp_query = new WP_Query( $query_args ); $listitems = ''; if ( have_posts() ) { while ( have_posts() ) { the_post(); $_genesis_displayed_ids[] = get_the_ID(); $listitems .= sprintf( '<li><a href="%s" title="%s">%s</a></li>', get_permalink(), the_title_attribute( 'echo=0' ), get_the_title() ); } if ( mb_strlen( $listitems ) > 0 ) printf( '<ul>%s</ul>', $listitems ); } //* Restore original query wp_reset_query(); } if ( ! empty( $instance['more_from_category'] ) && ! empty( $instance['posts_cat'] ) ) printf( '<p class="more-from-category"><a href="%1$s" title="%2$s">%3$s</a></p>', esc_url( get_category_link( $instance['posts_cat'] ) ), esc_attr( get_cat_name( $instance['posts_cat'] ) ), esc_html( $instance['more_from_category_text'] ) ); echo $after_widget; } }
수정본
파일 열기
<?php /** * Plugin Name * * @package Custom_Featured_Post_Widget * @author Gary Jones * @license GPL-2.0+ * @link http://gamajo.com/ * @copyright 2013 Gary Jones, Gamajo Tech */ /** * Custom Featured Post widget class. * * @package Custom_Featured_Post_Widget * @author Gary Jones */ class Custom_Featured_Post extends Genesis_Featured_Post { /** * Echo the widget content. * * @since 1.0.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, $_genesis_displayed_ids; //* Merge with defaults $instance = wp_parse_args( (array) $instance, $this->defaults ); echo $args['before_widget']; //* Set up the author bio if ( ! empty( $instance['title'] ) ) echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ) . $args['after_title']; $query_args = array( 'post_type' => 'post', 'cat' => $instance['posts_cat'], 'showposts' => $instance['posts_num'], 'offset' => $instance['posts_offset'], 'orderby' => $instance['orderby'], 'order' => $instance['order'], 'ignore_sticky_posts' => $instance['exclude_sticky'], ); //* Exclude displayed IDs from this loop? if ( $instance['exclude_displayed'] ) $query_args['post__not_in'] = (array) $_genesis_displayed_ids; $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>', 'xhtml' => sprintf( '<div class="%s">', 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', array ( 'alt' => get_the_title() ) ), ) ); if ( $instance['show_image'] && $image ) { $role = empty( $instance['show_title'] ) ? '' : 'aria-hidden="true"'; printf( '<a href="%s" class="%s" %s>%s</a>', get_permalink(), esc_attr( $instance['image_alignment'] ), $role, $image ); } if ( ! empty( $instance['show_gravatar'] ) ) { echo '<span class="' . esc_attr( $instance['gravatar_alignment'] ) . '">'; echo get_avatar( get_the_author_meta( 'ID' ), $instance['gravatar_size'] ); echo '</span>'; } if ( $instance['show_title'] ) echo genesis_html5() ? '<header class="entry-header">' : ''; if ( ! empty( $instance['show_title'] ) ) { $title = get_the_title() ? get_the_title() : __( '(no title)', 'genesis' ); /** * Filter the featured post widget title. * * @since 2.2.0 * * @param string $title Featured post title. * @param array $instance { * Widget settings for this instance. * * @type string $title Widget title. * @type int $posts_cat ID of the post category. * @type int $posts_num Number of posts to show. * @type int $posts_offset Number of posts to skip when * retrieving. * @type string $orderby Field to order posts by. * @type string $order ASC fr ascending order, DESC for * descending order of posts. * @type bool $exclude_displayed True if posts shown in main output * should be excluded from this widget * output. * @type bool $show_image True if featured image should be * shown, false otherwise. * @type string $image_alignment Image alignment: alignnone, * alignleft, aligncenter or alignright. * @type string $image_size Name of the image size. * @type bool $show_gravatar True if author avatar should be * shown, false otherwise. * @type string $gravatar_alignment Author avatar alignment: alignnone, * alignleft or aligncenter. * @type int $gravatar_size Dimension of the author avatar. * @type bool $show_title True if featured page title should * be shown, false otherwise. * @type bool $show_byline True if post info should be shown, * false otherwise. * @type string $post_info Post info contents to show. * @type bool $show_content True if featured page content * should be shown, false otherwise. * @type int $content_limit Amount of content to show, in * characters. * @type int $more_text Text to use for More link. * @type int $extra_num Number of extra post titles to show. * @type string $extra_title Heading for extra posts. * @type bool $more_from_category True if showing category archive * link, false otherwise. * @type string $more_from_category_text Category archive link text. * } * @param array $args { * Widget display arguments. * * @type string $before_widget Markup or content to display before the widget. * @type string $before_title Markup or content to display before the widget title. * @type string $after_title Markup or content to display after the widget title. * @type string $after_widget Markup or content to display after the widget. * } */ $title = apply_filters( 'genesis_featured_post_title', $title, $instance, $args ); $heading = genesis_a11y( 'headings' ) ? 'h4' : 'h2'; if ( genesis_html5() ) printf( '<%s class="entry-title"><a href="%s">%s</a></%s>', $heading, get_permalink(), $title, $heading ); else printf( '<%s><a href="%s">%s</a></%s>', $heading, get_permalink(), $title, $heading ); } if ( ! empty( $instance['show_byline'] ) && ! empty( $instance['post_info'] ) ) printf( genesis_html5() ? '<p class="entry-meta">%s</p>' : '<p class="byline post-info">%s</p>', do_shortcode( $instance['post_info'] ) ); if ( $instance['show_title'] ) echo genesis_html5() ? '</header>' : ''; if ( ! empty( $instance['show_content'] ) ) { echo genesis_html5() ? '<div class="entry-content">' : ''; if ( 'excerpt' == $instance['show_content'] ) { the_excerpt(); } elseif ( 'content-limit' == $instance['show_content'] ) { the_content_limit( (int) $instance['content_limit'], genesis_a11y_more_link( esc_html( $instance['more_text'] ) ) ); } else { global $more; $orig_more = $more; $more = 0; the_content( genesis_a11y_more_link( esc_html( $instance['more_text'] ) ) ); $more = $orig_more; } echo genesis_html5() ? '</div>' : ''; } genesis_markup( array( 'html5' => '</article>', 'xhtml' => '</div>', ) ); endwhile; endif; //* Restore original query wp_reset_query(); //* The EXTRA Posts (list) if ( ! empty( $instance['extra_num'] ) ) { if ( ! empty( $instance['extra_title'] ) ) echo $args['before_title'] . esc_html( $instance['extra_title'] ) . $args['after_title']; $offset = intval( $instance['posts_num'] ) + intval( $instance['posts_offset'] ); $query_args = array( 'cat' => $instance['posts_cat'], 'showposts' => $instance['extra_num'], 'offset' => $offset, ); $wp_query = new WP_Query( $query_args ); $listitems = ''; if ( have_posts() ) { while ( have_posts() ) { the_post(); $_genesis_displayed_ids[] = get_the_ID(); $listitems .= sprintf( '<li><a href="%s">%s</a></li>', get_permalink(), get_the_title() ); } if ( mb_strlen( $listitems ) > 0 ) printf( '<ul>%s</ul>', $listitems ); } //* Restore original query wp_reset_query(); } if ( ! empty( $instance['more_from_category'] ) && ! empty( $instance['posts_cat'] ) ) printf( '<p class="more-from-category"><a href="%1$s" title="%2$s">%3$s</a></p>', esc_url( get_category_link( $instance['posts_cat'] ) ), esc_attr( get_cat_name( $instance['posts_cat'] ) ), esc_html( $instance['more_from_category_text'] ) ); echo $args['after_widget']; } }
비교하기