當前位置: 首頁>>代碼示例>>PHP>>正文


PHP previous_post函數代碼示例

本文整理匯總了PHP中previous_post函數的典型用法代碼示例。如果您正苦於以下問題:PHP previous_post函數的具體用法?PHP previous_post怎麽用?PHP previous_post使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了previous_post函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: afsp_get_the_post_navigation

function afsp_get_the_post_navigation($args = array())
{
    $args = wp_parse_args($args, array('prev_text' => previous_post('%', '', 'no'), 'next_text' => '%title', 'screen_reader_text' => __('Post navigation')));
    $navigation = '';
    $previous = get_previous_post_link('<div class="nav-previous">%link</div>', $args['prev_text']);
    $next = get_next_post_link('<div class="nav-next">%link</div>', $args['next_text']);
    // Only add markup if there's somewhere to navigate to.
    if ($previous || $next) {
        $navigation = afsp_navigation_markup($previous . $next, 'post-navigation', $args['screen_reader_text']);
    }
    return $navigation;
}
開發者ID:jdozierezell,項目名稱:afsp,代碼行數:12,代碼來源:post-navigation.php

示例2: get_header

<?php get_header(); ?>

	<div id="content" class="widecolumn">
				
  <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
	
		<div class="navigation">
			<div class="alignleft"><?php previous_post('&laquo; %','','yes') ?></div>
			<div class="alignright"><?php next_post(' % &raquo;','','yes') ?></div>
		</div>
	
		<div class="post">
			<h2 id="post-<?php the_ID(); ?>"><a href="<?php echo get_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a></h2>
	
			<div class="entrytext">
				<?php the_content('<p class="serif">Read the rest of this entry &raquo;</p>'); ?>
	
				<?php link_pages('<p><strong>Pages:</strong> ', '</p>', 'number'); ?>
	
				<p class="postmetadata alt">
					<small>
						This entry was posted
						<?php /* This is commented, because it requires a little adjusting sometimes.
							You'll need to download this plugin, and follow the instructions:
							http://binarybonsai.com/archives/2004/08/17/time-since-plugin/ */
							/* $entry_datetime = abs(strtotime($post->post_date) - (60*120)); echo time_since($entry_datetime); echo ' ago'; */ ?> 
						on <?php the_time('l, F jS, Y') ?> at <?php the_time() ?>
						and is filed under <?php the_category(', ') ?>.
						You can follow any responses to this entry through the <?php comments_rss_link('RSS 2.0'); ?> feed. 
						
						<?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
開發者ID:staylor,項目名稱:develop.svn.wordpress.org,代碼行數:31,代碼來源:single.php

示例3: get_previous_post

        <?php 
        $Image = get_previous_post();
        $attr = wp_get_attachment_image_src(get_post_thumbnail_id($Image->ID), 'single-post-thumbnail');
        ?>
        <div class="postFooterPrev" style="background:url(<?php 
        echo $attr[0];
        ?>
);">
            <div class="postControlsOpaque">
            </div>
            <h2 class="previousHeader"><?php 
        echo previous_post('%', 'PREVIOUS', 'no');
        ?>
</h2>
            <?php 
        echo '<div class="previousJournalPost">' . previous_post('%', '', 'yes') . '</div>';
        ?>
        </div><?php 
        $Image = get_next_post();
        $attr = wp_get_attachment_image_src(get_post_thumbnail_id($Image->ID), 'single-post-thumbnail');
        ?>
<div class="postFooterNext"  style="background:url(<?php 
        echo $attr[0];
        ?>
); ">
            <div class="postControlsOpaque">
            </div>
            <h2 class="nextHeader"><?php 
        echo next_post('%', 'NEXT', 'no');
        ?>
</h2>
開發者ID:Chris-indigoRiver,項目名稱:indigoRiver,代碼行數:31,代碼來源:single-Journals.php

示例4: the_content

        the_content('Read the rest of this entry &raquo;');
        ?>
              <?php 
        edit_post_link('Edit.', '<p>', '</p>');
        ?>
            </div>
            <div class="clear"></div>
          </div><!-- (class="post") -->

        <?php 
        comments_template();
        ?>

        <div class="navigation">
          <div class="alignleft"><?php 
        previous_post('&laquo; Previous Post: %', '', 'yes');
        ?>
</div>
          <div class="alignright"><?php 
        next_post('Next Post: % &raquo;', '', 'yes');
        ?>
</div>
        </div><!-- (class="navigation") -->

      <?php 
    }
} else {
    ?>

        <h2>Error 404 - Not Found</h2>
        <p>Sorry, but you are looking for something that isn't here.</p>
開發者ID:jnsnkrllive,項目名稱:wordpress-theme-hhcyouth,代碼行數:31,代碼來源:single.php

示例5: the_time

        the_time(get_option('date_format'));
        ?>
</h3>
			<?php 
        the_content();
        ?>

		<?php 
    }
} else {
    ?>
			<p><?php 
    _e('Sorry, no posts matched your criteria.');
    ?>
</p>
		<?php 
}
?>

		<div class="timeNav">
			<?php 
previous_post('&laquo; %', 'Previous', 'no');
?>
			|
			<?php 
next_post('% &raquo;', 'Next', 'no');
?>
		</div>
	</div>
<?php 
get_footer();
開發者ID:brianbrennan,項目名稱:sandDune,代碼行數:31,代碼來源:single.php

示例6: the_time

                ?>
<br /><?php 
                the_time('F jS, Y @ g:i A');
                ?>
</p>

<?php 
            }
            comments_template();
            if (!is_page()) {
                ?>
<p>&laquo; <?php 
                next_post('%', 'Next: ', 'yes');
                ?>
 | <?php 
                previous_post('%', 'Previous: ', 'yes');
                ?>
 &raquo;</p>				
<?php 
            }
        } else {
            if ($i == 0) {
                if (is_category()) {
                    ?>
	<h1><?php 
                    _e('Posts in: ');
                    single_cat_title('');
                    ?>
</h1>
<?php 
                } else {
開發者ID:SymbiSoft,項目名稱:litprojects,代碼行數:31,代碼來源:index.php

示例7: comments_template

</div>
<div class="cat_tags_close"></div>

</div>

<?php 
        comments_template();
        ?>

<div class="next_previous_links">
<span class="alignleft"><?php 
        next_post('&laquo; %', '', 'yes');
        ?>
</span>
<span class="alignright"><?php 
        previous_post('% &raquo;', '', 'yes');
        ?>
</span>
<div class="clear"></div>

</div>
<?php 
    }
} else {
    ?>

<h2><?php 
    _e('Not Found', 'lightword');
    ?>
</h2>
<p><?php 
開發者ID:roblillack,項目名稱:lightword,代碼行數:31,代碼來源:single.php

示例8: previous_post

	<?php 
/*
	This navigation is used on most pages to move back and forth in your archives.
	It has been placed in its own file so it's easier to change across all of K2
*/
?>

	

	<?php 
if (is_single()) {
    ?>

	<!-- <div class="navigation">
		<div class="left"><?php 
    previous_post('<span>&laquo;</span> %', '', 'yes');
    ?>
</div>
		<div class="right"><?php 
    next_post(' % <span>&raquo;</span>', '', 'yes');
    ?>
</div>
		<div class="clear"></div>
	</div> -->

	<?php 
} else {
    ?>
		
	<div class="navigation">
		<div class="left"><?php 
開發者ID:ratjadi,項目名稱:andreaszeitler.net,代碼行數:31,代碼來源:navigation.php

示例9: edit_post_link

								</div>
							</div>

							<br>
							<br>
							
							<?php 
        edit_post_link(__('Edit this entry', 'html5reset'), '', '.');
        ?>

							<div class="row next-prev">
								<div class="col-md-3 lt">
									<br>
									<br>
									<p><?php 
        previous_post('%', '<i class="fa fa-angle-left"></i> <span>Previous</span>', 'no');
        ?>
</p>
								</div>
								<div class="col-md-6 text-center">
									<p class="capitalized text-black"><strong>Share this story</strong></p>
									<br>
									<p>
										<?php 
        include TEMPLATEPATH . '/social-icons.php';
        ?>
									</p>
								</div>
								<div class="col-md-3 rt text-right">
									<br>
									<br>
開發者ID:rosslibby,項目名稱:davinahearne,代碼行數:31,代碼來源:single.php

示例10: get_previous_post

   <?php 
     $prev_post = get_previous_post($in_same_cat = 'true');
     if (!empty($prev_post)) {
         ?>
   <?php 
         if (get_adjacent_post(false, '', true)) {
             ?>
   <div class="pull-left"  style="padding:10px;">
     <?php 
             previous_post('%', '<i class="material-icons">keyboard_arrow_left</i>', 'no');
             ?>
   </div>
   <div class="pull-left hidden-xs"> <small>Read Previous</small>
     <div>
       <?php 
             previous_post('%', '', 'yes', $in_same_cat = 'true');
             ?>
     </div>
   </div>
   <?php 
         }
         ?>
   <?php 
     }
     ?>
 </div>
 <div class="col-xs-6 text-right">
   <?php 
     $next_post = get_next_post($in_same_cat = 'true');
     if (!empty($next_post)) {
         ?>
開發者ID:alexkwa,項目名稱:alexkwa-theme,代碼行數:31,代碼來源:single.php

示例11: previous_post

						<div id="post-anterior-fin"><?php 
previous_post('&laquo; %', 'ANTERIOR', '', 1000);
?>
</div>
						<div id="post-siguiente-fin"><?php 
next_post('% &raquo; ', 'SIGUIENTE', '', 1000);
?>
</div>
					</div>
					<div id="separador-mobile">
						<div class="separador-post-comentario"></div>
					</div>
					<div id="separador-post-b">
						<div class="separador-post-comentario"></div>
						<div id="post-anterior-desktop"><?php 
previous_post('&laquo; %', 'POST ANTERIOR', '', 1000);
?>
</div>
						<div id="post-siguiente-desktop"><?php 
next_post('% &raquo; ', 'SIGUIENTE POST', '', 1000);
?>
</div>
						<div class="separador-post-comentario"></div>
					</div>
					<div id="comentarios-titulo">
						<h3>DEJA TU COMENTARIO</h3>
						<p>Si quieres insertar código: &lt;pre&gt;&lt;code&gt; TU CÓDIGO &lt;/code&gt;&lt;/pre&gt;.</p>
					</div>
					<?php 
comments_template();
?>
開發者ID:hernandemczuk,項目名稱:wordpressTheme,代碼行數:31,代碼來源:single.php

示例12: the_post_thumbnail

<div id="single_wrap" class="chat_move">
<div class="image_wrap">
<?php 
if (has_post_thumbnail()) {
    the_post_thumbnail('full');
}
?>
</div>

<div class="date"><?php 
the_time('jS F, Y');
?>
</div>

<?php 
previous_post('<div class="nav nav_prev">%</div>', '', 'no');
next_post('<div class="nav nav_next">%</div>', '', 'no');
?>
</div>
開發者ID:studioponto,項目名稱:Eternal-Torche,代碼行數:19,代碼來源:content-old.php

示例13: the_meta

        the_meta();
        ?>

									<p class="tags"><?php 
        echo get_the_term_list(get_the_ID(), 'custom_tag', '<span class="tags-title">' . __('Browse Related:', 'bonestheme') . '</span> ', ', ');
        ?>
</p>


								</section> <!-- end article section -->

								<footer class="article-header">
											  
									<span class="single-nav">
											<span class="prev"><?php 
        previous_post('%', '&laquo;  Last Clothing Item', 'no');
        ?>
  </span>
											<span class="next"><?php 
        next_post('% ', 'Next Clothing Item &raquo;', 'no');
        ?>
</span>
									</span>		
									
								</footer> <!-- end article footer -->

								<?php 
        comments_template();
        ?>

							</article> <!-- end article -->
開發者ID:brycefrees,項目名稱:dunia,代碼行數:31,代碼來源:single-custom_type.php

示例14: next_post

<section class="post-nav">
	<span class="post-button previous">
		<?php 
next_post('%', 'Previous', 'no');
?>
	</span>
	<span class="post-button next">
		<?php 
previous_post('%', 'Next', 'no');
?>
	</span>
</section>
開發者ID:BennyHudson,項目名稱:eaton,代碼行數:12,代碼來源:nav-posts.php

示例15: printf

			<?php 
    printf(esc_attr__('View all posts by %s', 'mm'), get_the_author());
    ?>
"><?php 
    the_author();
    ?>
</a> <?php 
    edit_post_link(__('Edit', '_s'), '<span class="edit-link">', '</span>');
    ?>
	
		</div>		
	</div>
	
	<div class="single-pagi"> 
		<div class="prev-nav"> <?php 
    previous_post("%", esc_attr__('&laquo; PREVIOUS ', 'mm'), "<br />", "yes", "mm");
    ?>
</div> | 
		<div class="next-nav"> <?php 
    next_post("%", esc_attr__('NEXT &raquo;', 'mm'), "<br />", "yes", "mm");
    ?>
</div> 
		<div class="cb"></div>
	</div>
	<div class="cb"></div>
</div>
</header><!-- .entry-header -->

<section>
	
	
開發者ID:m-godefroid76,項目名稱:devrestofactory,代碼行數:29,代碼來源:single.php


注:本文中的previous_post函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。