/** * Display the post content with a link to the single post * @since 1.0.0 */ function actions_post_content() { if (is_search()) { ?> <header class="page-header"> <h1 class="page-title"><?php printf(__('Search Results for: %s', 'actions'), '<span>' . esc_html(get_search_query()) . '</span>'); ?> </h1> </header><!-- .page-header --> <?php } while (have_posts()) { the_post(); ?> <article id="post-<?php the_ID(); ?> " <?php post_class(); ?> > <?php actions_post_header(); ?> <div class="entry-content"> <?php actions_post_thumbnail('full'); if ('post' == get_post_type()) { ?> <div class="entry-meta"> <?php actions_posted_on(); ?> </div> <?php } if (is_search()) { the_excerpt(); } else { the_content(sprintf(__('Continue reading %s', 'actions'), '<span class="screen-reader-text">' . esc_url(get_the_title()) . '</span>')); } wp_link_pages(array('before' => '<div class="page-links">' . __('Pages:', 'actions'), 'after' => '</div>')); //actions_entry_footer(); ?> </div><!-- .entry-content --> </article><!-- #post-## --> <?php } }
/** * Template for fallback single post view (ie. when no Flow Template assigned, this loop template will be in use) * * @package ThemifyFlow * @since 1.0.0 */ function render_content() { ?> <?php if (have_posts()) { while (have_posts()) { the_post(); ?> <?php get_template_part('includes/loop', 'single'); ?> <?php wp_link_pages(array('before' => '<p><strong>' . __('Pages:', 'themify-flow') . ' </strong>', 'after' => '</p>', 'next_or_number' => 'number')); ?> <?php comments_template(); ?> <?php } } ?> <?php }
/** * Content pagination */ function story_link_pages($content) { if (is_single()) { $content .= wp_link_pages(array('before' => '<div class="page-links">' . __('Pages:', 'story'), 'after' => '</div>', 'echo' => 0)); } return $content; }
/** * The default template for displaying single post content * * @package Customizr * @since Customizr 3.0 */ function tc_post_content() { //check conditional tags : we want to show single post or single custom post types global $post; $tc_show_single_post_content = isset($post) && 'page' != $post->post_type && 'attachment' != $post->post_type && is_singular() && !tc__f('__is_home_empty'); if (!apply_filters('tc_show_single_post_content', $tc_show_single_post_content)) { return; } //display an icon for div if there is no title $icon_class = in_array(get_post_format(), array('quote', 'aside', 'status', 'link')) ? apply_filters('tc_post_format_icon', 'format-icon') : ''; ob_start(); do_action('__before_content'); ?> <section class="entry-content <?php echo $icon_class; ?> "> <?php the_content(__('Continue reading <span class="meta-nav">→</span>', 'customizr')); ?> <?php wp_link_pages(array('before' => '<div class="pagination pagination-centered">' . __('Pages:', 'customizr'), 'after' => '</div>')); ?> </section><!-- .entry-content --> <?php do_action('__after_content'); $html = ob_get_contents(); if ($html) { ob_end_clean(); } echo apply_filters('tc_post_content', $html); }
/** * The template part for displaying page content * * @package Customizr * @since Customizr 3.0 */ function tc_page_content() { if ( 'page' != tc__f('__post_type') || ! is_singular() || tc__f( '__is_home_empty') ) return; ob_start(); do_action( '__before_content' ); ?> <div class="entry-content"> <?php the_content( __( 'Continue reading <span class="meta-nav">→</span>' , 'customizr' ) ); wp_link_pages( array( 'before' => '<div class="btn-toolbar page-links"><div class="btn-group">' . __( 'Pages:' , 'customizr' ), 'after' => '</div></div>', 'link_before' => '<button class="btn btn-small">', 'link_after' => '</button>', 'separator' => '', ) ); ?> </div> <?php do_action( '__after_content' ); $html = ob_get_contents(); if ($html) ob_end_clean(); echo apply_filters( 'tc_page_content', $html ); }
function test_thematic_link_pages_args() { $post = $this->factory->post->create_and_get(array('post_content' => 'Page 0<!--nextpage-->Page 1<!--nextpage-->Page 2<!--nextpage-->Page 3')); setup_postdata($post); $content = wp_link_pages(array('before' => sprintf('<nav class="page-link">%s', __('Pages:', 'thematic')), 'after' => '</nav>', 'echo' => '0')); $this->assertRegexp('/^<nav/', $content); }
/** * POST CONTENT - query posts * * output post content for Query Posts widget, based on predefined arguments * @since 7.0 */ function bizz_post_content_query($args = '', $post_count = false) { global $wp_query, $post, $opt; bizz_hook_before_post($post_count); #hook echo "<" . apply_filters('bizz_html5_section', "div") . " class=\"format_text\">\n"; $selflink = isset($args['thumb_selflink']) && $args['thumb_selflink'] == true ? true : false; $cropp = isset($args['thumb_cropp']) && $args['thumb_cropp'] != '' ? $args['thumb_cropp'] : 'c'; if (isset($opt['bizzthemes_thumb_show']['value']) && $args['thumb_display']) { bizz_image('width=' . $args['thumb_width'] . '&height=' . $args['thumb_height'] . '&class=thumbnail ' . $args['thumb_align'] . '&cropp=' . $cropp . '&selflink=' . $selflink . '&filter=' . $args['thumb_filter'] . '&sharpen=' . $args['thumb_sharpen'] . ''); } if ($args['remove_posts'] == '0') { if ($args['full_posts'] == '0' && (is_archive() || $wp_query->is_posts_page || is_search() || is_home())) { the_excerpt(); if ($args['read_more']) { echo apply_filters('bizz_read_more', '<span class="read-more"><a href="' . get_permalink() . '" class="url fn" rel="nofollow">' . $args['read_more_text'] . '</a></span>'); } } else { the_content($args['read_more_text']); } wp_link_pages(array('before' => '<div class="page-link">', 'after' => '</div>')); } echo '<div class="fix"><!----></div>'; echo "</" . apply_filters('bizz_html5_section', "div") . ">\n"; bizz_hook_after_post($post_count); #hook }
/** * Display the post content with a link to the single post * @since 1.0.0 */ function storefront_post_content() { ?> <?php if (is_search()) { ?> <div class="entry-summary"> <h2><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <?php the_excerpt(); ?> </div><!-- .entry-summary --> <?php } else { ?> <div class="entry-content" itemprop="articleBody"> <?php if (has_post_thumbnail()) { the_post_thumbnail('full', array('itemprop' => 'image')); } the_content(sprintf(__('Continue reading %s', 'storefront'), '<span class="screen-reader-text">' . get_the_title() . '</span>')); wp_link_pages(array('before' => '<div class="page-links">' . __('Pages:', 'storefront'), 'after' => '</div>')); ?> </div><!-- .entry-content --> <?php } }
/** * Passes some Tarski-specific arguments to wp_link_pages. * * @since 2.0 * * @uses wp_link_pages */ function tarski_link_pages() { $arguments = array('before' => '<p class="link-pages"><strong>' . __('Pages:', 'tarski') . '</strong>', 'after' => '</p>', 'next_or_number' => 'number', 'nextpagelink' => __('Next page', 'tarski'), 'previouspagelink' => __('Previous page', 'tarski'), 'pagelink' => '%', 'more_file' => '', 'echo' => true); if (!(has_post_format('aside') || in_category(get_tarski_option('asidescategory')))) { wp_link_pages($arguments); } }
function get_post_pagination() { if (!$this->is_single) { return ''; } return wp_link_pages(array('before' => '<div class="page-nav page-nav-post td-pb-padding-side">', 'after' => '</div>', 'link_before' => '<div>', 'link_after' => '</div>', 'echo' => false, 'nextpagelink' => '<i class="td-icon-menu-right"></i>', 'previouspagelink' => '<i class="td-icon-menu-left"></i>')); }
function mh_posts_pagination($content) { if (is_singular() && is_main_query()) { $content .= wp_link_pages(array('before' => '<div class="pagination">', 'after' => '</div>', 'link_before' => '<span class="pagelink">', 'link_after' => '</span>', 'nextpagelink' => __('»', 'mh'), 'previouspagelink' => __('«', 'mh'), 'pagelink' => '%', 'echo' => 0)); } return $content; }
/** * Display page-links for paginated posts before Jetpack share buttons and related posts. */ function argent_custom_link_pages($content) { if (is_singular() && is_main_query()) { $content .= wp_link_pages(array('before' => '<div class="page-links"><span class="page-links-title">' . esc_html__('Pages:', 'argent') . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>', 'echo' => 0)); } return $content; }
function lightseek_link_pages() { global $post; if (is_single()) { if (function_exists('wp_pagenavi')) { wp_pagenavi(array('type' => 'multipart')); } else { wp_link_pages(array('before' => '<div class="page-links">' . esc_html__('Pages:', '_lightseek'), 'after' => '</div>')); } } }
/** * Display the post content with a link to the single post * @since 1.0.0 */ function shop_isle_post_content() { ?> <div class="post-entry" itemprop="articleBody"> <?php the_content(sprintf(__('Continue reading %s', 'shop-isle'), '<span class="screen-reader-text">' . get_the_title() . '</span>')); wp_link_pages(array('before' => '<div class="page-links">' . __('Pages:', 'shop-isle'), 'after' => '</div>')); ?> </div><!-- .entry-content --> <?php }
function Article_Content() { ?> <div class="article__content"> <?php the_content(); wp_link_pages(array('before' => '<div class="page-links">' . esc_html__('Pages:', 'bemmy'), 'after' => '</div>')); ?> </div> <?php }
/** * Display the post content with a link to the single post * @since 1.0.0 */ function eighteen_tags_post_content() { ?> <div class="entry-content" itemprop="articleBody"> <?php eighteen_tags_post_thumbnail('full'); the_content(sprintf(__('Continue reading %s', 'eighteen-tags'), '<span class="screen-reader-text">' . get_the_title() . '</span>')); wp_link_pages(array('before' => '<div class="page-links">' . __('Pages:', 'eighteen-tags'), 'after' => '</div>')); ?> </div><!-- .entry-content --> <?php }
public function content() { ?> <div class="entry-content" itemprop="articleBody"> <?php eighteen_tags_post_thumbnail('full'); $this->blog_content(); wp_link_pages(array('before' => '<div class="page-links">' . __('Pages:', 'eighteen-tags'), 'after' => '</div>')); ?> </div><!-- .entry-content --> <?php }
/** * Pagination template tag. */ function wtf_paginate($title = '', $class = '') { $output = ''; /* Posts page pagination. */ if (!is_singular() && wtf_is_paginated()) { $output = '<nav class="pagination ' . $class . '" role="navigation">' . '<h1 class="visuallyhidden">' . $title . '</h1>' . get_next_posts_link(__('← Earlier posts', 'wtf')) . get_previous_posts_link(__('Newer posts →', 'wtf')) . '</nav>' . "\n"; /* Singular posts and pages pagination. */ } elseif (is_singular() && wtf_is_paginated()) { $args = array('before' => '', 'after' => '', 'next_or_number' => 'next', 'nextpagelink' => __('Next page →', 'wtf'), 'previouspagelink' => __('← Previous page', 'wtf'), 'echo' => 0); $output = '<nav class="pagination ' . $class . '" role="navigation">' . '<h1 class="visuallyhidden">' . $title . '</h1>' . wp_link_pages($args) . '</nav>' . "\n"; } echo $output; }
/** * Display the post content with a link to the single post * @since 1.0.0 */ function storefront_page_content() { ?> <div class="entry-content" itemprop="mainContentOfPage"> <?php the_content(); ?> <?php wp_link_pages(array('before' => '<div class="page-links">' . __('Pages:', 'storefront'), 'after' => '</div>')); ?> </div><!-- .entry-content --> <?php }
/** * Display the post content * PBO: options for featured image */ function storefront_post_content() { ?> <div class="entry-content" itemprop="articleBody"> <?php if (pbosfc_get_option('post_featured_image_size') != 'none') { storefront_post_thumbnail(pbosfc_get_option('post_featured_image_size')); } the_content(sprintf(__('Continue reading %s', 'storefront'), '<span class="screen-reader-text">' . get_the_title() . '</span>')); wp_link_pages(array('before' => '<div class="page-links">' . __('Pages:', 'storefront'), 'after' => '</div>')); ?> </div><!-- .entry-content --> <?php }
/** * Sets up theme defaults and registers support for various WordPress features. * * Note that this function is hooked into the after_setup_theme hook, which * runs before the init hook. The init hook is too late for some features, such * as indicating support for post thumbnails. */ function hayley_setup() { if (!isset($content_width)) { $content_width = 640; /* pixels */ } wp_link_pages(array('before' => '<div class="page-links">' . __('Pages:', 'hayley'), 'after' => '</div>')); /* * Make theme available for translation. * Translations can be filed in the /languages/ directory. * If you're building a theme based on Hayley, use a find and replace * to change 'hayley' to the name of your theme in all the template files. */ load_theme_textdomain('hayley', get_template_directory() . '/languages'); // Add default posts and comments RSS feed links to head. add_theme_support('automatic-feed-links'); /* * Let WordPress manage the document title. * By adding theme support, we declare that this theme does not use a * hard-coded <title> tag in the document head, and expect WordPress to * provide it for us. */ add_theme_support('title-tag'); /* * Enable support for Post Thumbnails on posts and pages. * * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/ */ add_theme_support('post-thumbnails'); // This theme uses wp_nav_menu() in two locations. register_nav_menus(array('top-menu' => __('Top Menu', 'hayley'))); register_nav_menus(array('main-menu' => __('Main Menu', 'hayley'))); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption')); /* * Enable support for Post Formats. * See https://developer.wordpress.org/themes/functionality/post-formats/ */ add_theme_support('post-formats', array('aside', 'image', 'video', 'quote', 'link')); // Set up the WordPress core custom background feature. add_theme_support('custom-background', apply_filters('hayley_custom_background_args', array('default-color' => 'ffffff', 'default-image' => ''))); }
/** * Display the post content with a link to the single post * @since 1.0.0 */ function storefront_post_content() { ?> <div class="entry-content" itemprop="articleBody"> <?php if (has_post_thumbnail()) { the_post_thumbnail('full', array('itemprop' => 'image')); } ?> <?php the_content(__('Continue reading <span class="meta-nav">→</span>', 'storefront')); ?> <?php wp_link_pages(array('before' => '<div class="page-links">' . __('Pages:', 'storefront'), 'after' => '</div>')); ?> </div><!-- .entry-content --> <?php }
function OnPageLoad() { if (have_posts()) { while (have_posts()) { the_post(); # Load Google Maps script if specified in a custom property $script = get_post_meta(get_the_ID(), "Use Google Maps", true); if ($script) { $this->SetHasGoogleMap(true); } # Load a script for the page if specified in a custom property $script = get_post_meta(get_the_ID(), "Javascript", true); if ($script) { $this->LoadClientScript($script); } ?> <h1><?php the_title(); ?> </h1> <div class="post" id="post-<?php the_ID(); ?> "> <?php $content = get_the_content(); $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); # Remove a <br /> that can get inserted after an image $content = preg_replace('/(<img[^>]*>)<br \\/>/', "\$1", $content); # Allow pictures to resize with screen on the mobile. Not ideal as should use thumbnails, but better than horizontal scrolling. $content = preg_replace('/ style="[^"]+"/', "", $content); $content = preg_replace('/<img([^>]*) height=["0-9]+/', "<img\$1", $content); echo $content; wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?> </div> <?php } } $this->AddSeparator(); $this->BuySomething(); }
/** * Display the post content with a link to the single post * @since 1.0.0 */ function shop_isle_post_content() { ?> <div class="post-entry" itemprop="articleBody"> <?php the_content(sprintf(__('Continue reading %s', 'shop-isle'), '<span class="screen-reader-text">' . get_the_title() . '</span>')); wp_link_pages(array('before' => '<div class="page-links">' . __('Pages:', 'shop-isle'), 'after' => '</div>')); ?> </div><!-- .entry-content --> <?php $tags_list = get_the_tag_list('', esc_html__(', ', 'shop-isle')); if ($tags_list) { printf('<span class="tags-links">' . esc_html__('Tagged %1$s', 'shop-isle') . '</span>', $tags_list); // WPCS: XSS OK. } ?> <?php }
function suevafree_after_content_function() { if (!suevafree_is_single()) { if (!suevafree_setting('suevafree_view_readmore') || suevafree_setting('suevafree_view_readmore') == "on") { do_action('suevafree_excerpt'); } else { if (suevafree_setting('suevafree_view_readmore') == "off") { the_content(); } } } else { the_content(); echo "<div class='clear'></div>"; wp_link_pages(); echo '<p class="categories"><strong>' . __("Categories: ", "suevafree") . '</strong>'; the_category(', '); echo '</p>'; the_tags('<footer class="line"><div class="entry-info"><span class="tags">Tags: ', ', ', '</span></div></footer>'); comments_template(); } }
function test_wp_link_pages() { $contents = array('One', 'Two', 'Three'); $content = join('<!--nextpage-->', $contents); $post_id = self::factory()->post->create(array('post_content' => $content)); $this->go_to('?p=' . $post_id); setup_postdata(get_post($post_id)); $permalink = sprintf('<a href="%s">', get_permalink()); $page2 = _wp_link_page(2); $page3 = _wp_link_page(3); $expected = "<p>Pages: 1 {$page2}2</a> {$page3}3</a></p>"; $output = wp_link_pages(array('echo' => 0)); $this->assertEquals($expected, $output); $before_after = " 1 {$page2}2</a> {$page3}3</a>"; $output = wp_link_pages(array('echo' => 0, 'before' => '', 'after' => '')); $this->assertEquals($before_after, $output); $separator = " 1{$page2}2</a>{$page3}3</a>"; $output = wp_link_pages(array('echo' => 0, 'before' => '', 'after' => '', 'separator' => '')); $this->assertEquals($separator, $output); $link = " <em>1</em>{$page2}<em>2</em></a>{$page3}<em>3</em></a>"; $output = wp_link_pages(array('echo' => 0, 'before' => '', 'after' => '', 'separator' => '', 'link_before' => '<em>', 'link_after' => '</em>')); $this->assertEquals($link, $output); $next = "{$page2}<em>Next page</em></a>"; $output = wp_link_pages(array('echo' => 0, 'before' => '', 'after' => '', 'separator' => '', 'link_before' => '<em>', 'link_after' => '</em>', 'next_or_number' => 'next')); $this->assertEquals($next, $output); $GLOBALS['page'] = 2; $next_prev = "{$permalink}<em>Previous page</em></a>{$page3}<em>Next page</em></a>"; $output = wp_link_pages(array('echo' => 0, 'before' => '', 'after' => '', 'separator' => '', 'link_before' => '<em>', 'link_after' => '</em>', 'next_or_number' => 'next')); $this->assertEquals($next_prev, $output); $next_prev_link = "{$permalink}Woo page</a>{$page3}Hoo page</a>"; $output = wp_link_pages(array('echo' => 0, 'before' => '', 'after' => '', 'separator' => '', 'next_or_number' => 'next', 'nextpagelink' => 'Hoo page', 'previouspagelink' => 'Woo page')); $this->assertEquals($next_prev_link, $output); $GLOBALS['page'] = 1; $separator = "<p>Pages: 1 | {$page2}2</a> | {$page3}3</a></p>"; $output = wp_link_pages(array('echo' => 0, 'separator' => ' | ')); $this->assertEquals($separator, $output); $pagelink = " Page 1 | {$page2}Page 2</a> | {$page3}Page 3</a>"; $output = wp_link_pages(array('echo' => 0, 'separator' => ' | ', 'before' => '', 'after' => '', 'pagelink' => 'Page %')); $this->assertEquals($pagelink, $output); }
/** * Display the post content with a link to the single post * @since 1.0.0 */ function storefront_post_content() { ?> <div class="entry-content" itemprop="articleBody"> <?php storefront_post_thumbnail('full'); // the_content( // sprintf( // __( 'Continue reading %s', 'storefront' ), // '<span class="screen-reader-text">' . get_the_title() . '</span>' // ) // ); if (is_single() or is_page()) { the_content(sprintf(__('Continue reading %s', 'storefront'), '<span class="screen-reader-text">' . get_the_title() . '</span>')); } else { the_excerpt(); } wp_link_pages(array('before' => '<div class="page-links">' . __('Pages:', 'storefront'), 'after' => '</div>')); ?> </div><!-- .entry-content --> <?php }
function Article_Continue() { ?> <div class="article__content article__content--continue"> <?php the_excerpt(); ?> <a href="<?php echo get_permalink(); ?> "> <?php echo sprintf(wp_kses(__('Continue reading %s <span class="meta-nav">»</span>', 'bemmy'), array('span' => array('class' => array()))), the_title('<span class="screen-reader-text">"', '"</span>', false)); ?> </a> <?php wp_link_pages(array('before' => '<div class="page-links">' . esc_html__('Pages:', 'bemmy'), 'after' => '</div>')); ?> </div> <?php }
/** * Footer for full-content posts. * Used on archives when 'blog_post_mode' == full */ function archives_full_footer() { ?> <footer style="margin-top: 2em;"> <i class="el-icon-tag"></i> <?php _e('Categories: ', 'shoestrap'); ?> <span class="label label-tag"> <?php echo get_the_category_list('</span> ' . '<span class="label label-tag">'); ?> </span> <?php echo get_the_tag_list('<i class="el-icon-tags"></i> ' . __('Tags: ', 'shoestrap') . '<span class="label label-tag">', '</span> ' . '<span class="label label-tag">', '</span>'); ?> <?php wp_link_pages(array('before' => '<nav class="page-nav"><p>' . __('Pages:', 'shoestrap'), 'after' => '</p></nav>')); ?> </footer> <?php }
/** * The template part for displaying page content * * @package Customizr * @since Customizr 3.0 */ function tc_content_page() { ?> <header> <?php if (!is_front_page()) { ?> <?php printf('<h1 class="entry-title format-icon">%1$s %2$s</h1>', get_the_title(), is_user_logged_in() && current_user_can('edit_pages') ? '<span class="edit-link btn btn-inverse btn-mini"><a class="post-edit-link" href="' . get_edit_post_link() . '" title="' . __('Edit page', 'customizr') . '">' . __('Edit page', 'customizr') . '</a></span>' : ''); ?> <hr class="featurette-divider"> <?php } ?> </header> <div class="entry-content"> <?php the_content(__('Continue reading <span class="meta-nav">→</span>', 'customizr')); ?> </div> <?php wp_link_pages(array('before' => '<div class="page-links">' . __('Pages:', 'customizr'), 'after' => '</div>')); ?> <footer class="entry-meta"> </footer><!-- .entry-meta --> <?php }