• Hi all,

    I checked the 2.5 Image/Media Uploader problems sticky post to see if this issue was address and searched for it without luck.

    I upgraded to 2.5 a week or two ago with no hitch. However, today when testing out posting a gallery (as in the video on the WP blog https://www.ads-software.com/development/2008/03/wordpress-25-rc2/) I noticed that after clicking on a photo in the gallery, it takes me to the “sub-post” as mentioned, but there is no thumbnail navigation to get to the other photos in the gallery (also the photos are off center). This leaves one on an orphan sub-post page.

    You can view my test gallery post and problem here on my site: https://heyletsrock.com/2008/04/14/wordpress-25-gallery-feature-test/ Just click on a pic in the gallery.

    I think it is a problem with the theme I use, however, I’m not sure what or were I need to ad any kind of code as this is a new feature. Plus, I don’t code very much, I just know some basic stuff.

    I use this theme https://www.blogohblog.com/wordpress-theme-rhea-v10/ which the designer claims is 2.5 compliant. I switched to the default theme briefly and the navigation appeared and the main image was centered.

    I posted this on the post on the theme creater’s post about all themes being 2.5 ready:

    I found a compatibility issue with the new WP 2.5 image gallery feature in the Rhea theme. I just created a post using the gallery feature as described in this video over on the WP blog:

    https://www.ads-software.com/development/2008/03/wordpress-25-rc2/

    The gallery seems to generate fine, however, when I click on an image in the gallery, the image displays off center and there are no navigation thumbnails, leaving one stranded on an orphan sub-post.

    I left the test post up on my site for you to check out if you would like.

    I deactivated the two plug-ins I was using after reading this post to see if that had any effect, it did not. I also switched to the default theme briefly and the gallery feature worked properly in it.

    I’m sure tweaking some bit of code would fix it, but I’m not advanced enough to know what to look for. I think Rhea is an excellent them and would love to see the gallery feature working. Please let me know if there is a fix.

    Thank you.

    He responded with this:

    You will have to style the gallery using CSS.

    I am rather confused as it is it’s basic functioning that doesn’t work, not that I want it to work or look a certain way. It worked in the default theme, so I assume some new code is missing from the theme I am using? If it is CSS what and where would I need to put in?

    Can anyone help me out with a fix to the navigation? I am really wanting the gallery feature to work properly as I am a photographer and want to us my blog to display my work.

    Thanks for taking the time to read.

Viewing 7 replies - 1 through 7 (of 7 total)
  • heyletsrock,

    Currently, the Rhea theme is using the single.php file to display your single gallery images. WordPress 2.5 has added a new template page called image.php that themes should use if using the gallery feature. I just discovered this file last night in the default theme.

    Basically, if WordPress is being asked to display a single attachment and the attachment is an image, WordPress will use the image.php template file.

    Here are a few steps you can take to add navigation to the Rhea theme while not messing with the rest of your blog (Please back up single.php before proceeding just in case):

    Open single.php from the Rhea theme in a text editor.

    Save this file as image.php to the Rhea theme directory.

    On lines 10 and 11 you will need to replace these two lines with:

    <p class="attachment">ID); ?>"><?php echo wp_get_attachment_image( $post->ID, 'medium' ); ?>
    
    <div class="caption"><?php if ( !empty($post->post_excerpt) ) the_excerpt(); // this is the "caption" ?></div>

    On lines 16 and 17, you should see this code:

    <div class="alignleft"><?php next_posts_link('? Previous Entries') ?></div>
    <div class="alignright"><?php previous_posts_link('Next Entries ?') ?></div>

    Delete this code and paste in this:

    <div class="alignleft"><?php previous_image_link() ?></div>
    <div class="alignright"><?php next_image_link() ?></div>

    This should get you to a place where you can see a functioning gallery page on your blog with “Previous” and “Next” links which are the thumbnail version of your images. The links will be all the way under your Comments box. To fix this, just move the “Navigation” div up in the code.

    Please let me know if this makes sense to you.

    Thread Starter heyletsrock

    (@heyletsrock)

    mfields,

    Thank you! This does makes sense to me, but I am going to have to hit the hay before I can try it. I have a couple of questions about it so far.

    1. Do I leave the original single.php file in the Rhea theme or do I remove it?

    After creating an images.php file from the single.php file and performing the edits you said the links will be under the comments box and to move the navigation div up in the code.

    2. Do you have a good guess of what line I should put it under?

    I ask because I had a terrible time of trying to get the “bookmark this” button to show up in all my posts above the comments and I tried it where I thought it should go and several other places. I ended up giving up and installing the widget that adds the button. I was thinking I might encounter the same problem.

    Thanks again. I will try this out as soon as possible today and get back to you.

    Thread Starter heyletsrock

    (@heyletsrock)

    I just had to take a look at the file before going to bed…

    One more question, replace lines 10 and 11, I’m a little confused on where they start and stop.

    is the following the original lines I am replacing?

    <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    				<small>Written by <?php the_author() ?> on <abbr title="<?php the_time('Y-m-d\TH:i:sO'); ?>"><?php unset($previousday); printf(__('%1$s – %2$s'), the_date('', '', '', false), get_the_time()) ?></abbr> - <?php if(function_exists('the_views')) { the_views(); } ?> </small><br /><br />

    Thanks.

    1. Do I leave the original single.php file in the Rhea theme or do I remove it?

    Leave it in there. This file will control the display of all of your single posts.

    2. Do you have a good guess of what line I should put it under?

    Maybe around line 12??? This is really up to you. The Default Theme’s image.php file uses these tags inside the loop, so you may not want to put them outside the loop. Other than that, I’d it’s personal preference.

    One more question, replace lines 10 and 11, I’m a little confused on where they start and stop.

    Those are the two lines… Sorry for not specifying above. This is actually the second set of instructions that I came up with for you. The first was “How to convert the default theme’s image.php for use in your theme” but Rhea has two custom sidebars and it was easier to explain the other method.

    Hope all goes well!

    Let me know if anything goes wrong

    For god’s sake, take a backup!

    Thread Starter heyletsrock

    (@heyletsrock)

    mfields,

    Thanks for the further explanation. I downloaded the Rhea them from the creator’s site, took the single.php file and renamed it image.php and then made the changes as mentioned in your post and uploaded it to the theme on my site. (I moved the navigation div to line 12.)

    The navigation is now there and working (sweet!), but I am having an issue with placement. Line 12 looks like where I want it to go, under the main displayed image, and above the tags links, but there is a stray bit of code visible in the post and the tags links are centered between the thumbnails instead of being underneath them.

    https://heyletsrock.com/2008/04/14/wordpress-25-gallery-feature-test/zwb_yas_06/

    Maybe this has to do with a piece of code I should have deleted, or perhaps I added something in almost the right spot? I haven’t had much luck with trying to place things where I want them with expected results with this theme as I mentioned earlier. I’m not sure what you mean by “the loop” so if I placed it outside of the loop I wouldn’t know it.

    Here is the code I am using in the image.php file

    <?php get_header(); ?>
    <div id="lsidebar"><?php include (TEMPLATEPATH . '/lsidebar.php'); ?></div>
    <div class="entry">
    
    	<?php if (have_posts()) : ?>
    
    		<?php while (have_posts()) : the_post(); ?>
    
    			<div class="post" id="post-<?php the_ID(); ?>">
    <p class="attachment">ID); ?>"><?php echo wp_get_attachment_image( $post->ID, 'medium' ); ?>
    <div class="caption"><?php if ( !empty($post->post_excerpt) ) the_excerpt(); // this is the "caption" ?></div>
    <div class="navigation">
    			<div class="alignleft"><?php previous_image_link() ?></div>
    			<div class="alignright"><?php next_image_link() ?></div>
    		</div>
    
    					<?php the_content('Read more &raquo;'); ?>
    
    <br />
    <?php the_tags('Tags: ', ', ', '<br />'); ?>Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?>  <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?><br />
    <div class="line"></div>
    			</div>
    <?php comments_template(); ?>
    
    	<?php endwhile; else: ?>
    
    		<p>Sorry, no posts matched your criteria.</p>
    
    <?php endif; ?>
    	</div></div>
    <div id="sidebar"><?php include (TEMPLATEPATH . '/rsidebar.php'); ?></div>
    <?php get_footer(); ?>

    Anything look funky?

    Thanks for your help!

    Heyletsrock,

    Your’s link doesn’t seem to work anymore, so I can help you with everything, I can tell you haw to fix that stray piece of code:

    Line 10, has a little bit of garbage on it:

    <p class="attachment">ID); ?>"><?php echo wp_get_attachment_image( $post->ID, 'medium' ); ?>

    Change to:

    <p class="attachment"><?php echo wp_get_attachment_image( $post->ID, 'medium' ); ?>

    If you post another link… I can probably help you the the other part of your request.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘2.5 Gallery – No Navigation’ is closed to new replies.