这会将字符串截断为 400 个字符,并用 ... 。只需通过指向带有 get_permalink() 的永久链接,将“阅读更多”链接添加到末尾。 <a href="<?php the_permalink() ?>">Read more 当然你也可以在第一行构建 read more 。不仅仅是将 '...' 替换为 '[Read more]' 原文由 Rvervuurt 发布,翻译遵循 CC...
> the_permalink() 将文章URL作为文本形式显示 <a href="<?php the_permalink(); ?>">permalink the_title() <?php the_title($before,$after,$display); ?> <?php the_title('', ''); ?> 显示或返回当前日志的标题,类似函数the_title_attribute(); Bloginfo() 参考: http://www.wordpress.la/...
用途:调用当前信息的网址,必须在主循环内使用 <?php the_permalink(); ?> the_content() 用途:显示内容, 如果文章插入了more标签 <?php the_content( 'Read more ...' ); ?> 有参数的情况下: the_excerpt() 用途:调用摘要,如果没有填写摘要则截取文章前55个字符 <?php the_excerpt(); ?> the_cate...
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute();?>"><?php the_title(); ?> <!-- .entry-title --> <?php the_excerpt(); ?> <?php echo do_shortcode ('[shareaholic app="share_buttons"
WordPress 模板标签 the_permalink() 说明 该标签显示当前被主循环(loop)处理的文章的固定链接URL。the_permalink()必须用在主循环(loop)中,该标签通常用来显示页面上文章的固定链接。由于the_permalink()只能显示正在被主循环处理的文章的固定链接,因此用户无法用它来显示任意文章。如果你希望显示某篇文章的固定链接,...
get_permalink()Retrieves and displays the URL (permalink) of the current post or a specified post by passing its ID as an argument. get_option()Used to retrieve values from the WordPress options table, making it helpful for accessing settings and configuration data. wp_enqueue_script()Register...
4.“the_content”函数将内容附加到页面插入的文件标题上。" the_permalink "函数匹配每个post的链接,这样在主页上未显示全文时,用户也可以访问到内容。 如果想在文件标题下添加一个简短的摘要,摘要包含内容的前200个字符,只需插入“the_excerpt”函数来代替“the_content”函数。因此,用户在单击链接时只能访问全文。
<h2 id="post-<?php the_ID(); ?>"> <a href="<?php the_permalink() ?>"><?php the_title(); ?> By <?php if ( function_exists( 'coauthors_posts_links' ) ) { coauthors_posts_links(); } else { the_author_posts_link(); } ?> / <a href="<?php the_archive_date();...
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" rel="bookmark"><?php the_title(); ?> <?php $exclude_id .= ',' . $post->ID; $i ++; } wp_reset_query(); } if ( $i < $post_num ) { $cats = ''; foreach ( get_the_category() as $cat ...
$output = ''; $output .= ''.get_the_title().''; $output .= ''.get_the_date().''; echo $output; } } else { // no posts found echo 'There are no posts to display.'; } // Restore original Post Data wp_reset_postdata(); ?> Notice ...