Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Page & Category Menu Bars (http://forum.bytesforall.com/forumdisplay.php?f=10)
-   -   Home link doesn't show in multi-post pages (http://forum.bytesforall.com/showthread.php?t=3083)

mcgiver058 Aug 21, 2009 04:57 PM

Home link doesn't show in multi-post pages
 
I'm using version 3.4.2 and my home link does not show up in multi-post pages, either set to BOTTOM or set to TOP AND BOTTOM

It works fine in the single post pages, however.
Any ideas?

Thanks

juggledad Aug 22, 2009 04:18 AM

this looks like a bug. I've sent Flynn some notes and am waiting to here from him about it.

mcgiver058 Aug 22, 2009 07:16 AM

Whew! I thought it was a glitch ;)
I "inhale sharply" [read "suck"] at php...

mcgiver058 Aug 25, 2009 09:20 PM

We have a solution! YAY! Thank you Rob! (see his work at http://www.robinomicon.com)

We had to modify the css.php and modify the bfa_next_previous_links.php pages.

Here are the changes:
in bfa_next_previous_links.php
lines 79-119 read as follows:

function bfa_next_previous_page_links($location = "Top") {

global $bfa_ata;


if ( !is_single() AND !is_page() AND
strpos($bfa_ata['location_multi_next_prev'],$location) !== FALSE AND

// don't display on WP Email pages
intval(get_query_var('email')) != 1 AND

// display only if next/prev links actually exist
show_posts_nav() ) {

if ( function_exists('wp_pagenavi') ) {

echo '<div class="wp-pagenavi-navigation">'; wp_pagenavi();
echo '</div>';

} else {

echo '<div class="navigation-'.strtolower($location).'">
<div class="older' . $nav_home_add . '">';

$bfa_ata['next_prev_orientation'] == 'Older Left, Newer Right' ?
next_posts_link($bfa_ata['multi_next_prev_older']) :
previous_posts_link($bfa_ata['multi_next_prev_newer']);

// echo ' &nbsp;</div>' . $nav_home_div . '<div class="newer' .
// $nav_home_add . '">&nbsp; ';

if (is_front_page() AND is_paged() ) {

echo '&nbsp;</div> <div class="home"><a href="' . $bfa_ata['get_option_home'] . '/">' .
$bfa_ata['home_single_next_prev'] . '</a></div> <div class="newer' .
$nav_home_add . '">&nbsp; ';


}
else {echo '&nbsp;</div> <div class="home"></div><div class="newer' .
$nav_home_add . '">&nbsp; ';}

in css.php, width for div.older, div.newer, div.older-home, div.newer-home, div.home were all changed to 33%

As with any modification, back up the original files before making any changes.
Hope this helps others..
Now on to the next challenge...

mcgiver058 Aug 25, 2009 09:37 PM

One small glitch - the link name for single post pages will also be the name for multi-post pages - I'll leave that fix to another hacker to play with.

mcgiver058 Aug 28, 2009 07:30 PM

glitch fix..
line 114 should read:
$bfa_ata['home_multi_next_prev'] . '</a></div> <div class="newer' .

That way, the correct value is displayed.

juggledad Aug 29, 2009 04:47 AM

The following will make the PAGE navagation work like the POST navagation - It will add HOME to the Navagation area
Atahualpa 3.4.2 - edit bfa_next_previous_posts.php
locate line 95-96 which should be
HTML Code:

                        echo '<div class="navigation-'.strtolower($location).'">
                        <div class="older' . $nav_home_add . '">';

and change them to
HTML Code:

                echo '<div class="navigation-'.strtolower($location).'">
                <div class="older' . ($bfa_ata['home_single_next_prev'] != '' ?
        '-home' : '') . '"
>
';

next find the following code (it will now be lines 103-104)
HTML Code:

                        echo ' &nbsp;</div>' . $nav_home_div . '<div class="newer' .
            $nav_home_add . '"
>
&nbsp; ';

and change them to
HTML Code:

                echo ' &nbsp;</div>' . ($bfa_ata['home_single_next_prev'] != '' ?
        '<div class="home"><a href="' . $bfa_ata['get_option_home'] . '/">' .
        $bfa_ata['home_single_next_prev'] . '</a></div>' : '') .
                '<div class="newer' . ($bfa_ata['home_single_next_prev'] != '' ?
        '-home' : '') . '"
>
&nbsp; ';

This will now cause home to display on in the navigation area. NOTE: you do not have to edit CSS.php

mcgiver058 Aug 30, 2009 05:05 AM

Worked like a charm - with one glitch - the home page link shows on the first page also - I'll play with the conditional and see what I come up with

mcgiver058 Aug 30, 2009 05:21 AM

change line 103-104 to read:
HTML Code:

if (is_front_page() AND is_paged() ) {
        echo ' &nbsp;</div>' . ($bfa_ata['home_single_next_prev'] != '' ? '<div class="home"><a href="' . $bfa_ata['get_option_home'] . '/">' . $bfa_ata['home_single_next_prev'] . '</a></div>' : '') . '<div class="newer' . ($bfa_ata['home_single_next_prev'] != '' ? '-home' : '') . '">&nbsp; ';
        }
else {
        echo '&nbsp;</div> <div class="home"></div><div class="newer' . $nav_home_add . '">&nbsp; ';
        }

This will not show the home link on the first page of multi-page posts, but will show the link on subsequent ages and on all single post pages
The else clause is simply a spacer for alignment

mcgiver058 Sep 4, 2009 09:51 PM

OK - I found another glitch in Next/Home/Previous script. On multi-post pages in the category view, it was not showing the home link but it was showing in the normal view.

Here is the fix:
Lines 85 - 126 should read as follows:
// display only if next/prev links actually exist
show_posts_nav() ) {

if ( function_exists('wp_pagenavi') ) {

echo '<div class="wp-pagenavi-navigation">'; wp_pagenavi();
echo '</div>';

} else {

echo '<div class="navigation-'.strtolower($location).'">
<div class="older' . ($bfa_ata['home_single_next_prev'] != '' ?
'-home' : '') . '">';

$bfa_ata['next_prev_orientation'] == 'Older Left, Newer Right' ?
next_posts_link($bfa_ata['multi_next_prev_older']) :
previous_posts_link($bfa_ata['multi_next_prev_newer']);

if (is_paged() ) {

echo ' &nbsp;</div>' . ($bfa_ata['home_single_next_prev'] != '' ?
'<div class="home"><a href="' . $bfa_ata['get_option_home'] . '/">' .
$bfa_ata['home_single_next_prev'] . '</a></div>' : '') .
'<div class="newer' . ($bfa_ata['home_single_next_prev'] != '' ?
'-home' : '') . '">&nbsp; ';
}
else {
echo '&nbsp;</div> <div class="home"></div><div class="newer' .
$nav_home_add . '">&nbsp; ';
}


$bfa_ata['next_prev_orientation'] == 'Older Left, Newer Right' ?
previous_posts_link($bfa_ata['multi_next_prev_newer']) :
next_posts_link($bfa_ata['multi_next_prev_older']);

echo '</div><div class="clearboth"></div></div>';

}

}
}

I had to change one of the conditionals to get things to work correctly


All times are GMT -6. The time now is 09:47 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.