Support » Theme: Kale » Kale pagination change

  • Hi,
    I am a new blogger and I am a bit stuck with custom pagination.
    I wrote my first post but realised it was too long and decided to break it in 3 parts/pages. I used a simple page break button to do that but I would like to change Page 1,2,3 to Part 1, Part 2, Part 3 (and instead of just a number for current page, I would it to actually say a word “part” and page number)
    I downloaded and activated WP-pagenavi plugin but after reading a lot of online information I am still confuse what to do next. Can you please explain for a dummy like me how to actually use the plugin in kale theme? which file do I have to open in FTP panel and what and where to type to change the default pagination to WP-pagenavi or other plugin (if pagenavi doesn’t work for me)?

    thank you

    The page I need help with: [log in to see the link]

Viewing 11 replies - 1 through 11 (of 11 total)
  • Hi there,

    Thank you for getting in touch with us and sorry about the delay in response.

    You don’t need any plugin for this. Please open wp-content/themes/kale/page.php file and replace this line:

    <div class="page-content"><?php the_content(); ?></div>

    with this code:

    <div class="page-content"><?php the_content(); ?></div>
    
    <?php wp_link_pages(array(
        'before' => '<p>',
        'after' => '</p>',
        'link_before' => __( 'Part ', 'kale' )
    )); ?>

    Kind regards

    Hi,
    thank you for reply.
    I’ve done what you suggested above but nothing seems to get changed. it still shows as Page 1, 2,3

    <!– Page Content –>
    <div id=”page-<?php the_ID(); ?>” <?php post_class(‘entry entry-page’); ?>>

    <?php if($kale_pages_featured_image_show == ‘Default’ && has_post_thumbnail()) { ?>
    <div class=”entry-thumb”><?php the_post_thumbnail( ‘full’, array( ‘alt’ => get_the_title(), ‘class’=>’img-responsive’ ) ); ?></div>
    <?php } ?>

    <?php if($kale_pages_featured_image_show != ‘Banner’) { ?>
    <?php $title = get_the_title(); ?>
    <?php if($title == ”) { ?>
    <h1 class=”entry-title”><?php esc_html_e(‘Page ID: ‘, ‘kale’); the_ID(); ?></h1>
    <?php } else { ?>
    <h1 class=”entry-title”><?php the_title(); ?></h1>
    <?php } ?>
    <?php } ?>

    <div class=”page-content”><?php the_content(); ?></div>

    <?php wp_link_pages(array(
    ‘before’ => ‘<p>’,
    ‘after’ => ‘</p>’,
    ‘link_before’ => __( ‘Part ‘, ‘kale’ )
    )); ?>

    </div>
    <!– /Page Content –>

    Theme Author lyrathemes

    (@lyrathemes)

    @firenda Please edit single.php.

    Change this line:

    <div class="single-content"><?php the_content(); wp_link_pages(); ?></div>

    to:

    <div class="single-content">
    <?php the_content(); 
    wp_link_pages(array(
        'before' => '<p>',
        'after' => '</p>',
        'link_before' => __( 'Part ', 'kale' )
    )); ?>
    </div>

    Thank you, that has worked for post. Can I also change word “Page” to “Part” on the blog page under post summary?

    • This reply was modified 5 months, 2 weeks ago by  firenda.

    You need to open wp-content/themes/kale/parts/entry.php file and replace these lines:

    <div class="entry-summary"><?php the_content(); ?><?php wp_link_pages(); ?></div>
            <?php } else { ?>
            <div class="entry-summary"><?php the_excerpt(); ?><?php wp_link_pages(); ?></div>

    with this:

    <div class="entry-summary"><?php the_content(); ?><?php wp_link_pages(array(
    		        'before' => '<p>',
    		        'after' => '</p>',
    		        'link_before' => __( 'Part ', 'kale' )
    	        )); ?></div>
            <?php } else { ?>
            <div class="entry-summary"><?php the_excerpt(); ?><?php wp_link_pages(array(
    		        'before' => '<p>',
    		        'after' => '</p>',
    		        'link_before' => __( 'Part ', 'kale' )
    	        )); ?></div>

    Hope that helps.

    ive done that and refreshed the page but now the blog page is empty. I went back to entry.php file and checked everything again. last line has red cross next to it and it says syntax error, unexpected $EOF

    sorry, my mistake. all is sorted. thank you for your help and I appreciate your patience!

    Hi,
    after the theme was updated in May, I had to go back and do the same changes again. But after Ive done the changes in entry.php my blog page disappeared like the last time. This time, though I cannot remember what I did to ractify it. can you please have a look and see and error? it says there;s a syntax error, but i cannot find it. HELP!

    <?php
    /**
    * Main template for displaying a post within a feed
    *
    * @package kale
    */
    ?>
    <?php

    $kale_blog_feed_meta_show = kale_get_option(‘kale_blog_feed_meta_show’);
    $kale_blog_feed_date_show = kale_get_option(‘kale_blog_feed_date_show’);
    $kale_blog_feed_category_show = kale_get_option(‘kale_blog_feed_category_show’);
    $kale_blog_feed_author_show = kale_get_option(‘kale_blog_feed_author_show’);
    $kale_blog_feed_comments_show = kale_get_option(‘kale_blog_feed_comments_show’);

    $kale_example_content = kale_get_option(‘kale_example_content’);

    if($kale_entry == ‘small’) { $kale_post_class = ‘entry-small’; $kale_image_size = ‘kale-thumbnail’; }
    if($kale_entry == ‘full’) { $kale_post_class = ‘entry-full’; $kale_image_size = ‘full’; }

    #variables passed from calling pages
    if(!isset($kale_frontpage_large_post)) $kale_frontpage_large_post = ‘no’;
    ?>
    <div id=”post-<?php the_ID(); ?>” <?php post_class(‘entry ‘ . $kale_post_class); ?>>

    <div class=”entry-content”>

    <div class=”entry-thumb”>
    <?php if(has_post_thumbnail()) { ?>
    “><?php the_post_thumbnail( $kale_image_size, array( ‘alt’ => get_the_title(), ‘class’=>’img-responsive’ ) ); ?>
    <?php } else if($kale_example_content == 1) { ?>
    “>” alt=”<?php the_title_attribute() ?>” class=”img-responsive” />
    <?php } ?>
    </div>

    <?php if($kale_blog_feed_meta_show == 1 && $kale_blog_feed_date_show == 1) { ?>
    <div class=”entry-date date updated”>“><?php echo get_the_date(); ?></div>
    <?php } ?>

    <?php if(get_the_title() != ”) { ?>
    <h3 class=”entry-title”>” title=”<?php the_title_attribute(); ?>”><?php the_title(); ?></h3>
    <?php } else { ?>
    <h3 class=”entry-title”>“><?php esc_html_e(‘Post ID: ‘, ‘kale’); the_ID(); ?></h3>
    <?php } ?>

    <?php if($kale_entry == ‘full’ ) { ?>
    <div class=”entry-summary”><?php the_content(); ?><?php wp_link_pages(array(
    ‘before’ => ‘<p>’,
    ‘after’ => ‘</p>’,
    ‘link_before’ => __( ‘Part ‘, ‘kale’ )
    )); ?></div>
    <?php } else { ?>
    <div class=”entry-summary”><?php the_excerpt(); ?><?php wp_link_pages(array(
    ‘before’ => ‘<p>’,
    ‘after’ => ‘</p>’,
    ‘link_before’ => __( ‘Part ‘, ‘kale’ )
    )); ?></div>

    <?php if($kale_blog_feed_meta_show == 1) { ?>
    <div class=”entry-meta”>
    <?php
    $kale_temp = array();
    if($kale_blog_feed_category_show == 1) $kale_temp[] = ‘<div class=”entry-category”>’ . get_the_category_list(‘, ‘). ‘</div>’;
    if($kale_blog_feed_author_show == 1) $kale_temp[] = ‘<div class=”entry-author”>’ . __(‘by ‘, ‘kale’)
    . ‘<span class=”vcard author”><span class=”fn”>’
    . get_the_author()
    . ‘</span></span>’
    . ‘</div>’;
    if($kale_blog_feed_date_show == 1 && $kale_entry == ‘vertical’)
    $kale_temp[] = ‘<br /><div class=”entry-date date updated”>’ . get_the_date() . ‘</div>’;
    if ( ! post_password_required() && comments_open() && $kale_blog_feed_comments_show == 1)
    $kale_temp[] = ‘<div class=”entry-comments”>‘. sprintf( _nx( ‘%1$s Comment’, ‘%1$s Comments’, get_comments_number(), ‘comments title’, ‘kale’ ), number_format_i18n( get_comments_number() ) ) .’</div>’;
    $kale_str = ”;
    if($kale_temp) $kale_str = implode(‘<span class=”sep”> – </span>’, $kale_temp);
    echo $kale_str;
    ?>
    </div>
    <?php } ?>

    </div>
    </div>

    diego

    (@corewpress)

    Hi @firenda,

    I’m not sure if it was an issue when you pasted the code here but all your single-quotes are wrong. It’s a small difference but you should use ' sign instead of . Same happens with your double-quote. Use this " instead of this .

    If you need further assistance contact us at this form https://www.lyrathemes.com/support/ where we can share more information regarding your particular case.

    Please, let me know if you need any further assistance.
    Kind regards,
    Diego

    Hi Diego,

    I just copied and pasted the content of the entry.php the only change i made was as per advise above. Other than that, the was the content of the page before.
    I will send a message to lyrasupport as per your advice. thank you!

    diego

    (@corewpress)

    Sounds great! Let’s follow up there.

Viewing 11 replies - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.