I want to apply different styles for a second page in single.php
or posts. How can I do this?
I have the following code in single.php
to split the page in two parts:
<!--nextpage-->
If there is a different method to add another “tab” to post or the like, I am grateful for any help… I just want to add a “custom page” to my post – like a gallery for a post – so the URL could be like this:
http://localhost/mysite/1024/postname/gallery/
http://localhost/mysite/1024/postname/custom-page/
Code in single.php
:
<?php get_header();?>
<main>
<?php get_sidebar() ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div id="post">
<div class="top-single-movie">
<div class="info">
<h3 class="title" id="post-<?php the_ID(); ?>">
<a href="https://wordpress.stackexchange.com/questions/233357/<?php the_permalink() ?>" rel="bookmark">
<?php the_title(); ?></a>
<?php if( get_field('date') ): ?>
( <?php the_field('date'); ?> )
<?php endif; ?>
</h3>
</div>
<?php if(has_post_thumbnail()) :
the_post_thumbnail('medium');
else :
echo '<img src="'.get_bloginfo('template_directory').'/img/default.png">';
endif;
?>
</div><!-- End. top-single-movie -->
<?php the_content(); ?>
<?php
wp_link_pages( array(
'before' => '<div class="page-link"><span>' . __( 'Pages:', 'tl_back' ) . '</span>',
'after' => '</div>'
) );
?>
<?php include (TEMPLATEPATH . '/php/single/tv-single-rand.php'); ?>
</div><!-- End. content-single-movie -->
<p class="tags"><?php the_tags(); ?> </p>
<!--?php comments_template(); // Get comments.php template ?-->
<?php endwhile; else: ?>
<p> <?php _e('Sorry, no posts matched your criteria.'); ?> </p>
<?php endif; ?>
<!-- END Loop -->
<ul class="navigationarrows">
<li class="previous">
<?php previous_post_link('« %link'); ?>
<?php if(!get_adjacent_post(false, '', true))
{ echo '<span>«Previous</span>'; } ?>
</li>
<li class="next">
<?php next_post_link('%link »'); ?>
<?php if(!get_adjacent_post(false, '', false)) { echo '<span>Next post:</span>'; } ?>
</li>
</ul><!-- end . navigationarrows -->
</div>
</main>
<?php get_footer();?>