This is popup preview that you can fill with any content you want.
The plugin include some shortcodes, you can read more about them at the bottom of this page. The main 3 sections to configure the popup are:
Appearance: Where you edit the look and feel of the popup.
Display Rules: Here you choose on which page to display the popup (Set to all by default)
Display options: Some important settings about the plugin, being the more important trigger action.
/* === 更新日の追加 ===
get_the_modified_time()の結果がget_the_time()より古い場合はget_the_time()を返す。
同じ場合はnullをかえす。
それ以外はget_the_modified_time()をかえす。
*/
function get_mtime($format) {
$mtime = get_the_modified_time('Ymd');
$ptime = get_the_time('Ymd');
if ($ptime > $mtime) {
return get_the_time($format);
} elseif ($ptime === $mtime) {
return null;
} else {
return get_the_modified_time($format);
}
}
/**** 更新日追加ボックス ****/
if( function_exists( 'thk_post_update_level' ) === false ):
function thk_post_update_level() {
add_meta_box( 'update_level', '更新方法', 'post_update_level_box', 'post', 'side', 'default' );
add_meta_box( 'update_level', '更新方法', 'post_update_level_box', 'page', 'side', 'default' );
}
add_action( 'admin_menu', 'thk_post_update_level' );
endif;
/* メインフォーム */
if( function_exists( 'post_update_level_box' ) === false ):
function post_update_level_box() {
global $post;
?>
<div style="padding-top: 5px; overflow: hidden;">
<div style="padding:5px 0"><input name="update_level" type="radio" value="high" checked="checked" />通常更新</div>
<div style="padding: 5px 0"><input name="update_level" type="radio" value="low" />修正のみ(更新日時を変更せず記事更新)</div>
<div style="padding: 5px 0"><input name="update_level" type="radio" value="del" />更新日時消去(公開日時と同じにする)</div>
<div style="padding: 5px 0; margin-bottom: 10px"><input id="update_level_edit" name="update_level" type="radio" value="edit" />更新日時を手動で変更</div>
<?php
if( get_the_modified_date( 'c' ) ) {
$stamp = '更新日時: <span style="font-weight:bold">' . get_the_modified_date( __( 'M j, Y @ H:i' ) ) . '</span>';
}
else {
$stamp = '更新日時: <span style="font-weight:bold">未更新</span>';
}
$date = date_i18n( get_option('date_format') . ' @ ' . get_option('time_format'), strtotime( $post->post_modified ) );
?>
<style>
.modtime { padding: 2px 0 1px 0; display: inline !important; height: auto !important; }
.modtime:before { font: normal 20px/1 'dashicons'; content: '\f145'; color: #888; padding: 0 5px 0 0; top: -1px; left: -1px; position: relative; vertical-align: top; }
#timestamp_mod_div { padding-top: 5px; line-height: 23px; }
#timestamp_mod_div p { margin: 8px 0 6px; }
#timestamp_mod_div input { border-width: 1px; border-style: solid; }
#timestamp_mod_div select { height: 21px; line-height: 14px; padding: 0; vertical-align: top;font-size: 12px; }
#aa_mod, #jj_mod, #hh_mod, #mn_mod { padding: 1px; font-size: 12px; }
#jj_mod, #hh_mod, #mn_mod { width: 2em; }
#aa_mod { width: 3.4em; }
</style>
<span class="modtime"><?php printf( $stamp, $date ); ?></span>
<div id="timestamp_mod_div" onkeydown="document.getElementById('update_level_edit').checked=true" onclick="document.getElementById('update_level_edit').checked=true">
<?php thk_time_mod_form(); ?>
</div>
</div>
<?php
}
endif;
/* 更新日時変更の入力フォーム */
if( function_exists( 'thk_time_mod_form' ) === false ):
function thk_time_mod_form() {
global $wp_locale, $post;
$tab_index = 0;
$tab_index_attribute = '';
if ( (int) $tab_index > 0 ) {
$tab_index_attribute = ' tabindex="' . $tab_index . '"';
}
$jj_mod = mysql2date( 'd', $post->post_modified, false );
$mm_mod = mysql2date( 'm', $post->post_modified, false );
$aa_mod = mysql2date( 'Y', $post->post_modified, false );
$hh_mod = mysql2date( 'H', $post->post_modified, false );
$mn_mod = mysql2date( 'i', $post->post_modified, false );
$ss_mod = mysql2date( 's', $post->post_modified, false );
$year = '<label for="aa_mod" class="screen-reader-text">年' .
'</label><input type="text" id="aa_mod" name="aa_mod" value="' .
$aa_mod . '" size="4" maxlength="4"' . $tab_index_attribute . ' autocomplete="off" />年';
$month = '<label for="mm_mod" class="screen-reader-text">月' .
'</label><select id="mm_mod" name="mm_mod"' . $tab_index_attribute . ">\n";
for( $i = 1; $i < 13; $i = $i +1 ) {
$monthnum = zeroise($i, 2);
$month .= "\t\t\t" . '<option value="' . $monthnum . '" ' . selected( $monthnum, $mm_mod, false ) . '>';
$month .= $wp_locale->get_month_abbrev( $wp_locale->get_month( $i ) );
$month .= "</option>\n";
}
$month .= '</select>';
$day = '<label for="jj_mod" class="screen-reader-text">日' .
'</label><input type="text" id="jj_mod" name="jj_mod" value="' .
$jj_mod . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />日';
$hour = '<label for="hh_mod" class="screen-reader-text">時' .
'</label><input type="text" id="hh_mod" name="hh_mod" value="' . $hh_mod .
'" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
$minute = '<label for="mn_mod" class="screen-reader-text">分' .
'</label><input type="text" id="mn_mod" name="mn_mod" value="' . $mn_mod .
'" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
printf( '%1$s %2$s %3$s @ %4$s : %5$s', $year, $month, $day, $hour, $minute );
echo '<input type="hidden" id="ss_mod" name="ss_mod" value="' . $ss_mod . '" />';
}
endif;
/* 「修正のみ」は更新しない。それ以外は、それぞれの更新日時に変更する */
if( function_exists( 'thk_insert_post_data' ) === false ):
function thk_insert_post_data( $data, $postarr ){
$mydata = isset( $_POST['update_level'] ) ? $_POST['update_level'] : null;
if( $mydata === 'low' ){
unset( $data['post_modified'] );
unset( $data['post_modified_gmt'] );
}
elseif( $mydata === 'edit' ) {
$aa_mod = $_POST['aa_mod'] <= 0 ? date('Y') : $_POST['aa_mod'];
$mm_mod = $_POST['mm_mod'] <= 0 ? date('n') : $_POST['mm_mod'];
$jj_mod = $_POST['jj_mod'] > 31 ? 31 : $_POST['jj_mod'];
$jj_mod = $jj_mod <= 0 ? date('j') : $jj_mod;
$hh_mod = $_POST['hh_mod'] > 23 ? $_POST['hh_mod'] -24 : $_POST['hh_mod'];
$mn_mod = $_POST['mn_mod'] > 59 ? $_POST['mn_mod'] -60 : $_POST['mn_mod'];
$ss_mod = $_POST['ss_mod'] > 59 ? $_POST['ss_mod'] -60 : $_POST['ss_mod'];
$modified_date = sprintf( '%04d-%02d-%02d %02d:%02d:%02d', $aa_mod, $mm_mod, $jj_mod, $hh_mod, $mn_mod, $ss_mod );
if ( ! wp_checkdate( $mm_mod, $jj_mod, $aa_mod, $modified_date ) ) {
unset( $data['post_modified'] );
unset( $data['post_modified_gmt'] );
return $data;
}
$data['post_modified'] = $modified_date;
$data['post_modified_gmt'] = get_gmt_from_date( $modified_date );
}
elseif( $mydata === 'del' ) {
$data['post_modified'] = $data['post_date'];
}
return $data;
}
add_filter( 'wp_insert_post_data', 'thk_insert_post_data', 10, 2 );
endif;
<?php
/**
* The Template for displaying all single posts
*
* @package WordPress
* @subpackage FSVBASIC
* @since FSVBASIC 1.0
*/
?>
<?php get_header(); ?>
<div id="main" class="main-content-area">
<div class="component-inner">
<div id="wrapbox" class="main-content-wrap">
<div id="primary" class="main-content-site" role="main">
<?php fsvbasic_breadcrumb() ; ?>
<?php while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'individual-post' ); ?>>
<header class="main-content-header">
<h1 class="main-content-title"><?php the_title(); ?></h1>
<div class="entry-meta">
<i class="fa fa-clock-o"></i> <?php the_time('Y/m/d');?>
<?php if(get_the_time('Y/m/d') != get_the_modified_date('Y/m/d')):?>
<i class="fa fa-history"></i> <?php the_modified_date('Y/m/d') ?>
<?php endif;?>
</div><!-- .entry-meta -->
</header><!-- .main-content-header -->
<div class="entry-content">
<?php if ( has_post_thumbnail() ) : ?>
<div class="attachment"><?php
$thumbnail_id = get_post_thumbnail_id($post->ID);
fsvbasic_resize_attachment( $thumbnail_id );
?></div><!-- .attachment -->
<?php
endif; // if ( has_post_thumbnail() )
the_content();
wp_link_pages( array( 'before' => '<div class="page-links">', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) );
?></div><!-- .entry-content -->
<div class="clear"></div>
<nav class="nav-single">
<div class="nav-previous"><?php previous_post_link( '%link', '前へ', true, '', 'category' ); ?></div><!-- .nav-previous -->
<div class="nav-next"><?php next_post_link( '%link', '次へ', true, '', 'category' ); ?></div><!-- .nav-next -->
</nav><!-- .nav-single -->
</article><!-- #post -->
<?php endwhile; // end of the loop. ?>
<?php comments_template( '', true ); ?>
</div><!-- #primary -->
<?php get_sidebar( 'left' ); ?>
</div><!-- #wrapbox -->
<?php get_sidebar( 'right' ); ?>
</div><!-- .component-inner -->
</div><!-- #main -->
<?php get_footer(); ?>
<?php
/**
* The default template for displaying content
*
* @package WordPress
* @subpackage FSVBASIC
* @since FSVBASIC 1.0
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'archive-post' ); ?>>
<?php
if ( ! is_attachment() ) :
if ( has_post_thumbnail() ) :
?>
<div class="entry-image">
<a href="<?php the_permalink(); ?>" rel="bookmark"><?php
$thumbnail_id = get_post_thumbnail_id($post->ID);
fsvbasic_resize_attachment( $thumbnail_id );
?></a>
</div><!-- .entry-image -->
<?php
endif; // if ( has_post_thumbnail() )
endif; // if ( ! is_attachment() )
?>
<div class="entry-summary">
<h2 class="excerpt-title"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
</div><!-- .entry-summary -->
</article><!-- #post -->
<?php
/**
* The template for displaying Category, Tag, Date, Author Archive pages.
*
* @link http://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage FSVBASIC
* @since FSVBASIC 1.0
*/
?>
<?php get_header(); ?>
<div id="main" class="main-content-area">
<div class="component-inner">
<div id="wrapbox" class="main-content-wrap">
<div id="primary" class="main-content-site" role="main">
<?php
fsvbasic_breadcrumb();
if ( have_posts() ) : // have_posts() check ?>
<header class="main-content-header">
<h1 class="main-content-title"><?php single_cat_title(); ?></h1><!-- .main-content-title -->
<?php if ( ( is_category() ) && ( category_description() ) ) : // Show an optional category description ?>
<div class="entry-meta">
<?php echo category_description(); ?>
</div><!-- .entry-meta -->
<?php endif; // Show an optional category description ?>
<?php if ( ( is_tag() ) && ( tag_description() ) ) : // Show an optional tag description ?>
<div class="entry-meta">
<?php echo tag_description(); ?>
</div><!-- .entry-meta -->
<?php endif; // Show an optional tag description ?>
</header><!-- .main-content-header -->
<div class="article-group">
<?php
while ( have_posts() ) : the_post();
get_template_part( 'content', get_post_format() );
endwhile;
?>
</div><!-- .article-group -->
<?php
else : // have_posts() check
get_template_part( 'content', 'none' );
endif; // end have_posts() check
fsvbasic_pagination();
?>
</div><!-- #primary -->
<?php get_sidebar( 'left' ); ?>
</div><!-- #wrapbox -->
<?php get_sidebar( 'right' ); ?>
</div><!-- .component-inner -->
</div><!-- #main -->
<?php get_sidebar( 'footer' ); ?>
<?php get_footer(); ?>
/**
* These codes are to display breadcrumb navigations.
*
* @since FSVBASIC 1.0
*/
if ( ! function_exists( 'fsvbasic_breadcrumb' ) ) :
function fsvbasic_breadcrumb() {
global $post;
$connector = ' > ' ; ?>
<div id="breadcrumb" class="main-breadcrumb">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name' ) ); ?>" rel="home">TOP</a>
<?php
if ( is_404() ) :
echo $connector; ?><span class="currentpage"><?php _e( 'This is somewhat embarrassing, isn’t it?', 'fsvbasic' ); ?></span>
<?php elseif ( is_search() ) :
echo $connector; ?><span class="currentpage"><?php printf( __( 'Search Results for : %s', 'fsvbasic' ), get_search_query() ); ?></span>
<?php elseif ( is_day() ) :
echo $connector; ?><span class="currentpage"><?php printf( __( 'Daily Archives : %s', 'fsvbasic' ), get_the_date() ); ?></span>
<?php elseif ( is_month() ) :
echo $connector; ?><span class="currentpage"><?php printf( __( 'Monthly Archives : %s', 'fsvbasic' ), get_the_date( _x( 'F Y', 'monthly archives date format', 'fsvbasic' ) ) ); ?></span>
<?php elseif ( is_year() ) :
echo $connector; ?><span class="currentpage"><?php printf( __( 'Yearly Archives : %s', 'fsvbasic' ), get_the_date( _x( 'Y', 'yearly archives date format', 'fsvbasic' ) ) ); ?></span>
<?php elseif ( is_author() ) :
echo $connector; ?><span class="currentpage"><?php printf( __( 'Author Archives : %s', 'fsvbasic' ), get_the_author() ); ?></span>
<?php elseif ( is_tag() ) :
echo $connector; ?><span class="currentpage"><?php printf( __( 'Tag Archives : %s', 'fsvbasic' ), single_tag_title( '', false ) ); ?></span>
<?php elseif ( is_category() ) :
$cat = get_queried_object();
if ( $cat->parent != 0 ):
$ancestors = array_reverse( get_ancestors( $cat->cat_ID, 'category' ) ); // get parent categories
foreach( $ancestors as $ancestor ) : // parent categories loop
echo $connector; ?><a href="<?php echo get_category_link( $ancestor ); ?>"><?php echo get_cat_name( $ancestor ); ?></a>
<?php endforeach;
endif;
echo $connector; ?><span class="currentpage"><?php printf( __( single_tag_title( '', false )) ); ?></span>
<?php elseif ( is_attachment() ) :
if($post -> post_parent != 0 ):
echo $connector; ?><a href="<?php echo get_permalink( $post->post_parent); ?>"><?php echo get_the_title( $post->post_parent ); ?></a>
<?php endif;
echo $connector; ?><span class="currentpage"><?php echo $post->post_title; ?></span>
<?php elseif ( is_single() ) :
$categories = get_the_category( $post->ID );
$cat = $categories[0];
if( $cat->parent != 0 ) :
$ancestors = array_reverse( get_ancestors( $cat->cat_ID, 'category' ) ) ; // get parent categories
foreach($ancestors as $ancestor): // parent categories loop
echo $connector; ?><a href="<?php echo get_category_link( $ancestor ); ?>"><?php echo get_cat_name( $ancestor ); ?></a>
<?php endforeach;
endif; ?>
<?php echo $connector; ?><a href="<?php echo get_category_link( $cat->cat_ID ); ?>"><?php echo $cat->cat_name ; ?></a>
<?php echo $connector; ?><span class="currentpage"><?php echo $post->post_title; ?></span>
<?php elseif ( is_page() ) :
if( $post->post_parent != 0 ) :
$ancestors = array_reverse( $post->ancestors );
foreach($ancestors as $ancestor):
echo $connector; ?><a href="<?php echo get_permalink( $ancestor ); ?>"><?php echo get_the_title( $ancestor ); ?></a>
<?php endforeach;
endif;
echo $connector; ?><span class="currentpage"><?php echo $post->post_title; ?></span>
<?php else :
echo $connector; ?><span class="currentpage"><?php echo $post->post_title; ?></span>
<?php endif; ?>
</div><!-- #breadcrumb -->
<?php }
endif;
<?php
/**
* The Template for displaying all single posts
*
* @package WordPress
* @subpackage FSVBASIC
* @since FSVBASIC 1.0
*/
?>
<?php get_header(); ?>
<div id="main" class="main-content-area">
<div class="component-inner">
<div id="wrapbox" class="main-content-wrap">
<div id="primary" class="main-content-site" role="main">
<?php fsvbasic_breadcrumb() ; ?>
<?php while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'individual-post' ); ?>>
<header class="main-content-header">
<h1 class="main-content-title"><?php the_title(); ?></h1>
<div class="entry-meta">
<?php fsvbasic_entry_meta(); ?>
<?php if ( is_user_logged_in() ) : ?><?php edit_post_link( __( 'Edit', 'fsvbasic' ), '<p class="post-edit-link-base">', '</p>' ); ?></p><?php endif; ?>
</div><!-- .entry-meta -->
</header><!-- .main-content-header -->
<div class="entry-content">
<?php if ( has_post_thumbnail() ) : ?>
<div class="attachment"><?php
$thumbnail_id = get_post_thumbnail_id($post->ID);
fsvbasic_resize_attachment( $thumbnail_id );
?></div><!-- .attachment -->
<?php
endif; // if ( has_post_thumbnail() )
the_content();
wp_link_pages( array( 'before' => '<div class="page-links">', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) );
?></div><!-- .entry-content -->
<div class="clear"></div>
<nav class="nav-single">
<div class="nav-previous"><?php previous_post_link( '%link', '前へ', true, '', 'category' ); ?></div><!-- .nav-previous -->
<div class="nav-next"><?php next_post_link( '%link', '次へ', true, '', 'category' ); ?></div><!-- .nav-next -->
</nav><!-- .nav-single -->
</article><!-- #post -->
<?php endwhile; // end of the loop. ?>
<?php comments_template( '', true ); ?>
</div><!-- #primary -->
<?php get_sidebar( 'left' ); ?>
</div><!-- #wrapbox -->
<?php get_sidebar( 'right' ); ?>
</div><!-- .component-inner -->
</div><!-- #main -->
<?php get_sidebar( 'footer' ); ?>
<?php get_footer(); ?>
<?php
/**
* The template for displaying Category, Tag, Date, Author Archive pages.
*
* @link http://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage FSVBASIC
* @since FSVBASIC 1.0
*/
?>
<?php get_header(); ?>
<div id="main" class="main-content-area">
<div class="component-inner">
<div id="wrapbox" class="main-content-wrap">
<div id="primary" class="main-content-site" role="main">
<?php
fsvbasic_breadcrumb();
if ( have_posts() ) : // have_posts() check ?>
<header class="main-content-header">
<h1 class="main-content-title"><?php single_cat_title(); ?></h1><!-- .main-content-title -->
<?php if ( ( is_category() ) && ( category_description() ) ) : // Show an optional category description ?>
<div class="entry-meta">
<?php echo category_description(); ?>
</div><!-- .entry-meta -->
<?php endif; // Show an optional category description ?>
<?php if ( ( is_tag() ) && ( tag_description() ) ) : // Show an optional tag description ?>
<div class="entry-meta">
<?php echo tag_description(); ?>
</div><!-- .entry-meta -->
<?php endif; // Show an optional tag description ?>
<div class="entry-meta"><p> <?php
$url = sprintf( 'https://%1$s%2$s', $_SERVER["HTTP_HOST"], $_SERVER["REDIRECT_URL"] );
printf( '<a href="%s?orderby=post_date&order=ASC">古い順</a> | ', $url );
printf( '<a href="%s?orderby=post_date&order=DESC">新着順に戻す</a>', $url );
?></p></div>
</header><!-- .main-content-header -->
<div class="article-group">
<?php
while ( have_posts() ) : the_post();
get_template_part( 'content', get_post_format() );
endwhile;
?>
</div><!-- .article-group -->
<?php
else : // have_posts() check
get_template_part( 'content', 'none' );
endif; // end have_posts() check
fsvbasic_pagination();
?>
</div><!-- #primary -->
<?php get_sidebar( 'left' ); ?>
</div><!-- #wrapbox -->
<?php get_sidebar( 'right' ); ?>
</div><!-- .component-inner -->
</div><!-- #main -->
<?php get_sidebar( 'footer' ); ?>
<?php get_footer(); ?>
ポップアップサンプルこんな感じで画像も挿入出来ます。 普通に文章だけだとなぜか1行に重なって表示されてしまいます。 文字色や太字程度なら表示できます。 見出しタグ(H2、H3等)は無視されます。