Archived

This topic is now archived and is closed to further replies.

  • 0

Single-post Page: Previous/Next titles overrun text

Question

Posted · Report post

Hi guys, The title above and this link capture the problem well: http://aocpmr.net/2010/06/submission-are-being-accepted-for-resident-writing-award/. What's a good solution- should the single-post be moved down, or should the layout of the "next" post be altered. It's the "next" post title that is the problem. Is there a topic on this already? I couldn't find one. Thank you, Nick

Share this post


Link to post
Share on other sites

19 answers to this question

Posted · Report post

Yeah you got me...I was instructing on how to switch the next and previous post, but now that I think about it that wouldn't make sense. I'm thinking the best way to do this would be to just reverse the order from which the post thumbs are put into the carousel so the older posts will be on the left To do this you'd have to go into template_carousel.php and make sure that this line: `<?php $recentposts = get_posts('numberposts='.$carouselitems.'&offset=0');?>` Has this extra parameter order=asc like so `<?php $recentposts = get_posts('numberposts='.$carouselitems.'&offset=0&order=ASC');?>` Hope that helps

Share this post


Link to post
Share on other sites

Posted · Report post

Hi Catrina, Both of those options did not remedy the problem- the post title and the next title were still overlapping at times. Just so we're all on the same page now, I believe there are 2 issues that are not related: 1) Aesthetically: the single-post title and the "next ==>"title run into each other. I've offered a solution which I think would work: VFD9X.png 2) Functionally, the "Next Post=>" title link is broken and doesn't take you to that post when clicked. (The "<=Previous Post" DOES work, so it must be in the code. Interesting, it seems that when I click on the Next Post title, the carousel:posthumbs shifts to that post, but the single-post page doesn't appear. Perhaps you can see this for yourself on my site, such as this url.

Share this post


Link to post
Share on other sites

Posted · Report post

Success! The Previous/Next titles are functioning and look good, and the carousel is functioning with postThumbs order reversed- now it matches the direction of the Previous/Next titles. Thanks for your assistance- greatly appreciated!

Share this post


Link to post
Share on other sites

Posted · Report post

The only reason why the "next" post link isn't working is because the clickable area if being hidden by the main post area itself. It's a z-index problem. In general though the theme isn't supposed to react the way that your is. I added this ` .post-nav .next a { white-space:nowrap; } ` so the text didn't break into 4lines but for some reason the next link toggles the carousel. Can you confirm this?

Share this post


Link to post
Share on other sites

Posted · Report post

Hi Adam, When you say you added

.post-nav .next a {
	white-space:nowrap;
	}

, what are you referring to? To your code? Where? As seen here, I can independently access either the PostTitle or the NextPostTitle (don't seem to be overlapped completely), but the NextPostTitle link just toggles the carousel- that's it. And, when you click on the carousel arrows, it just toggles to the end- odd behavior. So, to summarize, I still have the the same two problems as described above, with a related problem being the odd behavior of the carousel when the arrows are clicked.

Share this post


Link to post
Share on other sites

Posted · Report post

You can add the CSS to the Custom Code area in the theme options but that doesn't really help solve the problem. It looks like you have a lot of validation errors related to the facebook scripts on your page and I'm not sure if that is related. The carousel should definitely not be activated by the next-post link, I'm wondering also if you can test this with all plug-ins and added script turned off or commented out.

Share this post


Link to post
Share on other sites

Posted · Report post

Will do, and I'll let you know. Thanks for keeping up with this- this is kinda imprt for my site vs. just something cool.

Share this post


Link to post
Share on other sites

Posted · Report post

Update: I temporarily got rid of all custom CSS code, and deactivated nearly all plug-ins that might even be related. The nextPostTitle still breaks on multiple lines, the nextposttitle doesn't direct to next post, and the carousel awkwardly toggles- it's clear when you click around a few times. link

Share this post


Link to post
Share on other sites

Posted · Report post

Update: I temporarily got rid of all custom CSS code, and deactivated nearly all plug-ins that might even be related. The nextPostTitle still breaks on multiple lines, the nextposttitle doesn't direct to next post, and the carousel awkwardly toggles- it's clear when you click around a few times. link

Share this post


Link to post
Share on other sites

Posted · Report post

I see now. I guess I hadn't seen the carousel on the posts page often enough because it's clear to me now that the "next-post" link needs to be a different class. Both the carousel and next-post have a class of "next" since they're not normally on the same page. In your _posts.php file you need to edit the post-nav and change the class to something like "next-post" (it's right up there on the top of the file) You'll also have to reflect the change in the theme.css (approx line 395) Please let me know if you need more detailed instruction

Share this post


Link to post
Share on other sites

Posted · Report post

Hi Adam, Here's my link. Edits to post.php: I updated the classes in post.php to next-post, and previous-post to be consistent. I only made those two changes

<?php if(is_single()):?>
			<div class="post-nav fix"> <span class="previous-post"><?php previous_post_link('%link') ?></span> <span class="next-post"><?php next_post_link('%link') ?></span></div>
		<?php endif;?>
Edits to theme.css: I updated the classes there too:
/* next & previous post navigation */
	.post-nav {
		clear: both;
		padding:20px 20px 5px 20px;
		font-size: 11px;
		position: relative;
	}
		.post-nav a, .post-nav a:visited {
			color: #999;
			text-decoration: none;
		}
		.post-nav a:hover {
			color: #000000;
			text-decoration: none;
		}
		.post-nav .previous-post a {
			float: left;
			display: block;
			padding-left: 24px;
			background: url(../images/post-nav-previous.png) no-repeat left center;
		}
		.post-nav .next-post a {
			float: right;
			display:block;
			padding-right: 24px;
			text-align: right;
			background: url(../images/post-nav-next.png) no-repeat right center;
		}

The result: It appears to be behaving better, but I've lost the arrow icons, the nextPostTitle isn't right justified, and the previous and next titles are blended..

Share this post


Link to post
Share on other sites

Posted · Report post

Adam, It's working! It looks great. The only thing that is awkward is that the Previous/Next on the carousel are the opposite directions to the Previous/Next titles. When you click the right-arrow for the NextTitle, you're also going Left in the carousel. It's a little confusing/counterintuitive for the user to figure out. How do I flip the order of carousel thumbnails, so the most recent post is on the right, in order to match the right-arrow of the next post? Thanks!

Share this post


Link to post
Share on other sites

Posted · Report post

I wish I could answer that, but that sounds like a hard code customization that you'll need to wait for developer help on. As always, bump your topic. Thanks, Bryan

Share this post


Link to post
Share on other sites

Posted · Report post

If the single post is moved down, that will create some unneeded space, so it'd be best to adjust the "next" post link so it's moved up. In the custom CSS box in your theme options, try adding this code to see if it nudges that link up a little:

#maincontent span.next {margin-top: -10px;}

Share this post


Link to post
Share on other sites

Posted · Report post

thanks bryan, appreciate the read. almost there. bumparoo

Share this post


Link to post
Share on other sites

Posted · Report post

I tried that, but it still didn't look right. Would something like this work?

<== Title of Previous Post __________________________________________________Title of the Next Post ==> TITLE of CURRENT POST
MORE IMPORTANTLY however, this visual glitch made me uncover a technical glitch- when you click on the "next post" title, nothing happens. It is not working correctly. The previous post is working. aocpmr.net/news

Share this post


Link to post
Share on other sites

Posted · Report post

Hm, I highly doubt that it has to do with the length of the post title (since the title in the "previous" link is longer). Perhaps adjusting the width of it would make a difference. Something alone the lines like this (in the custom CSS box):

#maincontent span.next {width: 200px;}

Share this post


Link to post
Share on other sites

Posted · Report post

You would just need to swap the position in _posts.php `<?php previous_post_link('%link') ?>` will now come after the next post link. then you may have to switch the float direction in the css for each.

Share this post


Link to post
Share on other sites

Posted · Report post

Hey Adam, In this final step, I need a bit more details on how I do this: I'm trying to flip the order of the thumbnails in any carousel that is set-up for postThumbs, so the most recent post is on the right. All the other things (PreviousTitle and NextTitle) stays the same. Can you confirm that is what you were instructing me to do above? I got the impression that would change the Previous/Next titles, not the carousel. I swapped the order, like so:

<?php if (!is_404() && have_posts()) : while (have_posts()) : the_post(); ?>
	    <?php if(is_single()):?>
	        <div class="post-nav fix"> <span class="next-post"><?php next_post_link('%link') ?></span> <span class="previous-post"><?php previous_post_link('%link') ?></span> </div>
	    <?php endif;?>

And then, I searched "carousel" in theme.css and found nothing. Are we talking bout the same thing?

Share this post


Link to post
Share on other sites