1

I have been trying to modify my theme to show an additional button on the attachment page. The reason for this is that I am using the standard wordpress gallery with a link to the attachment page. I would like to show a button underneath the image stating something like "Get in touch".

I have looked at the files listed under appearance>editor and can see that my theme (sunrain) has no special files for the gallery so presumable it is using the standard single.php.

I have tried to modify this page, firstly as a test just so I can see something coming through but have failed. In my test I simply add some additional text after the page title but when I saved the document and reload my website it would not show.

<?php

/*  SunRain Theme's Single Page to display Single Page or Post
    Copyright: 2012-2013, D5 Creation, www.d5creation.com
    Based on the Simplest D5 Framework for WordPress
    Since SunRain 1.0
*/


get_header(); ?>
<div id="container">
<div id="content">

          <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
            <?php sunrain_post_date(); ?><div class="post-container">
            <h1 class="page-title"><?php the_title(); ?></h1><h1 class="page-title">Test title</h1>

            <div class="content-ver-sep"> </div>
            <div class="entrytext"><?php the_post_thumbnail('thumbnail'); ?>
            <?php the_content(); ?>
            </div>
            <div class="clear"> </div>
            <div class="up-bottom-border">
            <?php  wp_link_pages( array( 'before' => '<div class="page-link"><span>' . '' . '</span>', 'after' => '</div><br/>' ) ); ?>
            <?php sunrain_post_meta(); ?>
            <div class="content-ver-sep"> </div>
            <div class="floatleft"><?php previous_post_link('&laquo; %link'); ?></div>
            <div class="floatright"><?php next_post_link('%link &raquo;'); ?></div><br /><br />
            <?php if ( is_attachment() ): ?>

            <div class="floatleft"><?php previous_image_link( false, '&laquo; ' . of_get_option('pi3', 'Previous Image') ); ?></div>
            <div class="floatright"><?php next_image_link( false,  of_get_option('ni3', 'Next Image') . ' &raquo;' ); ?></div> 
            <?php endif; ?>
            </div>

            <?php endwhile;?>

          <!-- End the Loop. -->          

            <?php comments_template(); ?>
            <?php if (get_post_meta( get_the_ID(), 'sb_pl', true ) == 'fullwidth' ): echo '<style>#content { width: 100%; } #right-sidebar { display: none; }</style>'; endif; ?>

</div></div>            
<?php get_sidebar(); ?>
<?php get_footer(); ?>

Is there anything that I am missing or just forgetting to do, am I modifying the wrong page?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.