Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Post-Kicker, -Byline & -Footer (http://forum.bytesforall.com/forumdisplay.php?f=17)
-   -   [SOLVED] Using images in Next/Previous Navigation (http://forum.bytesforall.com/showthread.php?t=14267)

tnandrick May 21, 2011 11:07 PM

[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

juggledad May 22, 2011 03:52 AM

did you look at the doc on the option page? where you can use '→' for a right arrow and '←' for a left arrow?

tnandrick May 22, 2011 09:29 AM

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.

juggledad May 22, 2011 10:37 AM

Hmmm, what brwoser? In safari on a mac it turns into the link cursor using Atahualpa 3.6.7

tnandrick May 22, 2011 10:41 AM

Looking at the source, it shows:

<div class="clearfix navigation-middle">
<div class="older-home">&laquo; &nbsp;</div><div class="home"><a href="http://www.reformationcomic.com/">Home</a></div><div class="newer-home">&nbsp; &raquo;</div></div>

I'm using Firefox on a Mac

tnandrick May 22, 2011 10:48 AM

Same condition in Safari...

lmilesw May 22, 2011 12:35 PM

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.

tnandrick May 22, 2011 01:21 PM

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?

lmilesw May 22, 2011 02:26 PM

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.

juggledad May 23, 2011 02:48 PM

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

bswb97 Sep 12, 2011 12:29 AM

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.

juggledad Sep 12, 2011 06:03 AM

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

lmilesw Sep 12, 2011 06:41 AM

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.

bswb97 Sep 13, 2011 12:33 AM

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') {
                        if($bfa_ata['single_next_prev_same_cat'] == "Yes") {
                                previous_post_link('%link', 'Previous in category', TRUE);
                        } else {
                                previous_post_link($bfa_ata['single_next_prev_older']);
                        }
                } else {
                        if($bfa_ata['single_next_prev_same_cat'] == "Yes") {
                                next_post_link('%link', 'Next in category', TRUE);
                        } else {
                                next_post_link($bfa_ata['single_next_prev_newer']);
                        }
                }

All I've done is replace everything in the parentheses with ('%link', 'Previous in category', TRUE) and ('%link', 'Next post in category', TRUE). Is there something obvious I'm missing? The Previous one pops out the "Previous in category" syntax while the Next one displays the Atahualpa default.

juggledad Sep 13, 2011 05:48 AM

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

bswb97 Sep 13, 2011 08:48 AM

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.

juggledad Sep 13, 2011 12:27 PM

should, but it can't hurt to change both

bswb97 Sep 13, 2011 03:42 PM

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.

juggledad Sep 13, 2011 05:38 PM

there are two places lines 101-109 and lines 126-134 - did you change them both?

bswb97 Sep 13, 2011 06:18 PM

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.