indigojones66 Posted July 17, 2015 Share Posted July 17, 2015 (edited) Re:http://indigojones.co.uk/ana/philosophers/image5/Hi. I have made an attachment page for a wordpress site but wish to move the title/text to the right of the image and also move the next and previous buttons to bottom right of the page. Could you help? Thanks in advance <?php get_header(); ?> <?php get_template_part('element', 'page-header'); ?> <div id="main" class="main"> <div class="container"> <section id="content" class="content"> <?php if(have_posts()) while(have_posts()): the_post(); ?> <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <div class="page-content"> <?php the_content(); ?> <?php cpotheme_post_pagination(); ?> </div> </div> <?php comments_template('', true); ?> <?php endwhile; ?> </section> <?php get_sidebar(); ?> <div class="clear"></div> </div> </div> <?php echo wp_get_attachment_image( get_the_ID(), 'large' ); ?> <h6 class="post-title"><?php the_title(); ?></h6> <div class="entry"> <div class="entry-inner"> <?php the_content(); ?> </div> <div class="clear"></div> </div><!--/.entry--> <nav id="image-navigation" class="navigation image-navigation"> <div class="nav-links"> <?php previous_image_link( false, '<div class="previous-image">' . __( 'Next Image', '$text_domain' ) . '</div>' ); ?> <?php next_image_link( false, '<div class="next-image">' . __( 'Previous Image', '$text_domain' ) . '</div>' ); ?> </div><!-- .nav-links --> </nav><!-- #image-navigation --> <?php get_footer(); ?> Edited July 17, 2015 by Ch0cu3r Quote Link to comment https://forums.phpfreaks.com/topic/297335-position-divs-in-php/ Share on other sites More sharing options...
Ch0cu3r Posted July 17, 2015 Share Posted July 17, 2015 This is not achieved with PHP. How elements appear/positioned on your webpage is down to your HTML/CSS. Your navigation links can be aligned to the right, by applying text-align: right; I presume to the .navigation selector in your stylesheet To have the image title appear to the side of the image, first swap the imge and post tile lines around, so its <h6 class="post-title"><?php the_title(); ?></h6> <?php echo wp_get_attachment_image( get_the_ID(), 'large' ); ?> Then add the following selector to your stylesheet h6.post-title { float: right; margin-top: 15px; } Quote Link to comment https://forums.phpfreaks.com/topic/297335-position-divs-in-php/#findComment-1516617 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.