Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Excerpts, Read more, Pagination (http://forum.bytesforall.com/forumdisplay.php?f=20)
-   -   Hiding Navigation Links on Pages, Keeping them on Posts (http://forum.bytesforall.com/showthread.php?t=15766)

jackieboy Oct 25, 2011 03:12 PM

Hiding Navigation Links on Pages, Keeping them on Posts
 
Great theme, terrific support, thank you.

I have a question. I recently added next/previous navigation on each of my single posts. I am using a static front page with password protection which a user must enter to get to the posts.

On this static page where the password box is, the navigation links appear. I would like to disable/hide these links on this static page and keep it for the single posts.

Any ideas?

Thanks in advance!

juggledad Oct 25, 2011 04:26 PM

you could use the CSS 'display: none;' on the element and use 'body.logged-in' as part of the selector.

so you would have (where 'element' is the html element in question)
HTML Code:

element {display:none;}
body.logged-in element {display: block;}

so it would shut it off for everything, then if the user is logged in, it would turn it on

jackieboy Oct 26, 2011 01:32 AM

Thank you for that. Just a bit more clarification if possible.

Where would this code be entered? What variable would element need to be replaced with?


element {display:none;}
body.logged-in element {display: block;}

jackieboy Oct 26, 2011 04:35 AM

I found this in css:

div.navigation-top {
<?php bfa_incl('next_prev_style_top') ?>
}

Is this the location?

Would it look like:

div.navigation-top {display:none;}
body.logged-in element {display: block;}

Not sure if where this gets inserted exactly.

Thanks again, Jack

jackieboy Oct 26, 2011 04:43 AM

you are genius .. just figured it out

thank u

juggledad Oct 26, 2011 04:45 AM

it goes in the option 'CSS Inserts' - give it a try.
buy: the second line - you need to change 'element'

jackieboy Oct 26, 2011 04:45 AM

actually, the links disappeared when logged out, but do not appear when logged in

i did this:

div.navigation-top {display:none;}
body.logged-in div.navigation-top {display: block;}

div.navigation-top {
<?php bfa_incl('next_prev_style_top') ?>
}

div.navigation-middle {
<?php bfa_incl('next_prev_style_middle') ?>
}

div.navigation-bottom {display:none;}
body.logged-in div.navigation-bottom {display: block;}

div.navigation-bottom {
<?php bfa_incl('next_prev_style_bottom') ?>
}

jackieboy Oct 26, 2011 05:14 AM

well, i can't get the links to reappear when logged in.

is there anything else I can do?

thanks

juggledad Oct 26, 2011 05:27 AM

all you should have to do is go to ATO->Add HTML/CSS Inserts->CSS Inserts and add
HTML Code:

div.navigation-top {display:none;}
body.logged-in div.navigation-top {display: block;}

you should not be changing any theme code.

jackieboy Oct 26, 2011 05:36 AM

thank you, yes, once you made the clarification, i left the theme code alone and entered the code in css inserts exactly as you have stated. when logged out, the nav links are hidden as intended, but when logged in, they are still hidden. that is my dilemma.

juggledad Oct 26, 2011 05:43 AM

I'd have to take a look to see what was happening

juggledad Oct 26, 2011 05:46 AM

When logged in, go to a page and then view the source
Look for the <body......> statement and see if the class 'logged-in' exists. If they are logged into Wordpress as a user, it should show up. If you are using some other login scheme, then there might be another class you need to use.

juggledad Oct 26, 2011 06:44 AM

Ok, the way you are doing this, the user is not really logging into Wordpress so the class 'logged-in' is not set by Wordpress. There is nothing that indicates the user is actually logged in. You might want to reconsider the way you are doing this.

Where did you get this method from?

jackieboy Oct 26, 2011 06:44 AM

perhaps thats why its not working properly. i do not provide wordpress user access to posts, just password post protection using a global password. i use the plugin titled global post password.

jackieboy Oct 26, 2011 06:53 AM

i put it together just by looking for a way to protect posts, then added search engine blocking and no follow tags, i am a weekend warrior and was looking for something functional

jackieboy Oct 26, 2011 07:05 AM

perhaps you are suggesting to use wordpress user names for access to this area?

juggledad Oct 26, 2011 07:20 AM

I'd check to see if the plugin can assign a user I'd, maybe a global one, so Wordpress would assign the class and you could use it inthe css


All times are GMT -6. The time now is 01:31 PM.

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