• Resolved marcAroma

    (@marcaroma)


    Hi there,

    I am trying to create a custom post page to e.g. change the wording from “Previous post” to “Previous painting”, hide the author and date and category info, use the full width template, include a list of other bespoke content links, etc…

    I created a child theme, so how do I go best about it?

    Many thanks for any suggestions ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • Theme Author TT Themes

    (@tomastoman)

    Hi,

    I recommend you to copy the original “single.php” template from the parent theme to your child theme’s directory where you can edit it.

    To remove the post meta data (author, date, category and tags), just delete the following code in your child theme’s “single.php” (or, you can just select the option “Hide” in “Theme Options > Posts/Pages Settings > Display Featured Image on single posts”):

    <?php if ( $photostory_options_db['photostory_display_meta_post'] != 'Hide' ) { ?>
        <p class="post-meta">
          <span class="post-info-author"><?php _e( 'Author: ', 'photostory' ); ?><?php the_author_posts_link(); ?></span>
          <span class="post-info-date"><?php echo get_the_date(); ?></span>
    <?php if ( comments_open() ) : ?>
          <span class="post-info-comments"><a href="<?php comments_link(); ?>"><?php printf( _n( '1 Comment', '%1$s Comments', get_comments_number(), 'photostory' ), number_format_i18n( get_comments_number() ), get_the_title() ); ?></a></span>
    <?php endif; ?>
        </p>
        <div class="post-info">
          <p class="post-category"><span class="post-info-category"><?php the_category(', '); ?></span></p>
          <p class="post-tags"><?php the_tags( '<span class="post-info-tags">', ', ', '</span>' ); ?></p>
        </div>
    <?php } ?>

    To change the next/prev post links, please replace the following code:

    <?php photostory_prev_next('photostory-post-nav'); ?>

    with this one where you can customize the text strings (“Previous post” and “Next post”):

    <?php $photostory_previous_post = get_adjacent_post( false, "", true );
    $photostory_next_post = get_adjacent_post( false, "", false ); ?>
    <div id="<?php echo $nav_id; ?>" class="navigation" role="navigation">
    	<div class="nav-wrapper">
      <div class="nav-wrapper-line"></div>
    <?php if ( !empty($photostory_previous_post) ) { ?>
      <p class="nav-previous"><a href="<?php echo esc_url(get_permalink($photostory_previous_post->ID)); ?>" title="<?php echo esc_attr($photostory_previous_post->post_title); ?>"><?php _e( '&larr; Previous post', 'photostory' ); ?></a></p>
    <?php } if ( !empty($photostory_next_post) ) { ?>
    	<p class="nav-next"><a href="<?php echo esc_url(get_permalink($photostory_next_post->ID)); ?>" title="<?php echo esc_attr($photostory_next_post->post_title); ?>"><?php _e( 'Next post &rarr;', 'photostory' ); ?></a></p>
    <?php } ?>
       </div>
    </div>

    Best regards,
    Tomas Toman

    Thread Starter marcAroma

    (@marcaroma)

    Many thanks for the tip!!! I already found the single.php and started editing, but your tip about ‘Hide’ is much better then to delete lines…

    Thanks allot!
    Marc

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to change the single post display page’ is closed to new replies.