[SOLVED] Using images in Next/Previous Navigation
I would like to use images as links for the next/previous navigation at the bottom of posts. I understand that Atahualpa calls wp_link_pages() to generate the navigation links, and it doesn't look like that function accepts any arg's except string values from the documentation. I can insert an image into the navigation, and it shows up, but I don't understand how to make the image into a link. (Or how to make anything other than %link work, for that matter)
In the options, it says "You can use single and double quotes, and HTML". Can anyone show me an example of the syntax to use something other than %link? I'd be happy with just an "arrow" that functioned as the link if I can't use an image, rather than a text based link. As of now, anything other than the default %link does not create a link at all, just plain text Thanks in advance, Tim Atahualpa 3.5.3 WP 3.1.2 http://www.reformationcomic.com/archives/114 |
did you look at the doc on the option page? where you can use '→' for a right arrow and '←' for a left arrow?
|
Yes, I have. It does not make the arrow into a link, just a plain text arrow that does not link. The only way those options create a link is if I include %link.
If I input just "«" , "»" "→", or "←", when you go to the page and hover over the "link" the cursor changes to a text-editing cursor, not a link cursor. Using only arrows work fine for the comments section, but the post navigation does not. |
Hmmm, what brwoser? In safari on a mac it turns into the link cursor using Atahualpa 3.6.7
|
Looking at the source, it shows:
<div class="clearfix navigation-middle"> <div class="older-home">« </div><div class="home"><a href="http://www.reformationcomic.com/">Home</a></div><div class="newer-home"> »</div></div> I'm using Firefox on a Mac |
Same condition in Safari...
|
For Next/Previous links on single post pages that does indeed look like the way it works. I know of no way to change that without digging into the code.
|
OK, so if I turned off the nav feature for single post pages in options, could insert some code below loop using get_adjacent_post to find next and previous posts, and use this as a nav feature, or is this not advised?
|
I am not sure and 3.6.7 doesn't have a "below the loop" section so you would have to edit one of the theme files.
|
Atahualpa uses the WordPress Function 'previous_post_link()' to create the next/prev POSTS links.
and uses the WordPress Function 'previous_posts_link()' to create the next/prev PAGES links. you can read about previous_post_link here and you can read about previous_posts_link here Neither routing allows for passing an image, they just return the text link |
Is there any resolution on this? I'm coming up with the same issue, where any custom navigation text for a single post prev/next is just text. It only works for me using %link, and I'd like it to simply be the arrow without the post name.
|
You will have to edit the theme code bra_next_previous_links.php and change the call to the previous_post_link() function and next_post_link() function to pass a null for the 'link' parameter.
You should read up about the functions http://codex.wordpress.org/Function_...next_post_link http://codex.wordpress.org/Function_...ious_post_link and make sure to document what you do because you will have to change it each upgrade of the theme |
Just for the heck of it I did a search on wordpress.org for "next previous images" and came up with this for posts and this for pages but perhaps you already checked there and discounted these for some reason. I just didn't want you to miss them if you hadn't.
|
I looked at JD's links and it works for Previous but it's not taking for Next. Here's my code:
HTML Code:
if ($bfa_ata['next_prev_orientation'] == 'Older Left, Newer Right') { |
You only made changes foe half the locations. Note they are in an 'IF' and you changed the 'TRUE' part, not the 'FALSE' part of the statement
|
I probably should have clarified that I've turned the "same post category" setting to yes. If that's the case, shouldn't I only update the TRUE settings? I'm not sure why the same syntax (basically) works for Previous but not for Next.
|
should, but it can't hurt to change both
|
Still not taking. Is there something buggy about the next_posts_link function or is it pretty straightforward?
I'd hoped to minimize text by not using post titles, but that might be the only workaround at this point. |
there are two places lines 101-109 and lines 126-134 - did you change them both?
|
That did it. Are there two spots, one for left navigation and one for right navigation? That would make sense.
|
All times are GMT -6. The time now is 06:27 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.