|
#1
Oct 24, 2012, 03:38 PM
|
|
Hi BFA! I got a question about Navigation top links: How i can hide them in all the posts with one specific tag?
Example: i got 5 articles with tag "ataimages" and on this articles i want to hide the navigation top links.
Thanks for support!
|
#2
Oct 24, 2012, 06:35 PM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
you have to be a bit more specific. are you talking about single post pages?
so if you have post A, B ann C and B has the tag you don't want a link on. I read post A and there is a PREVious link that I click and it takes me to B and now you want no links to show? then how do you get to post C?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#3
Oct 25, 2012, 12:08 PM
|
|
I make a screen to understand me better : Screen Here
|
#4
Oct 26, 2012, 08:43 AM
|
|
One ideea: I need to implement one tag div in body class to configure tag articles in CSS, but I don't know why doesn't work. The CSS wich I implement for .portfolio .navigation-top {display: none;} doesn't work...
|
#5
Oct 26, 2012, 09:37 AM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
You can not do this on the blog page via CSS.
It can be done on a multi post TAG page or on any single post page WHEN gotten to by clicking on the tag.
the reason is that you would have to start your selector with a
HTML Code:
body.tag-xxxxx div.navigation-top {display: none;}
but on the blog page no TAG classes are added to the BODY statement.
You might, and I mean might be able to do it on the blog page by editing the theme code and coding some conditionals, but I don't think you will be able to get it to work in all cases.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#6
Oct 26, 2012, 09:59 AM
|
|
I create one function:
Quote:
function add_cats_to_body_class($classes='') {
if (is_single()) {
global $post;
$category = array_values(get_the_tags($post->ID));
$slug = $category[0]->slug;
$classes[]=$slug;
}
return $classes;
}
add_filter('body_class', 'add_cats_to_body_class');
|
He return in my Body class the tag name, but when i try to write in Css.php the body.tagname {..} doesn't work.... I tried also to create in wrapper one div with tag references:
Quote:
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
...but also makes me trouble with one space in my header. The functions to add a specific tag div, to include my elements works, but the CSS don't listen me...
|
#7
Oct 26, 2012, 10:03 AM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
I would have to see the site to see what is going on - what is the url?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#8
Oct 26, 2012, 10:09 AM
|
|
Here is the link: Link. I activate now the function to see in the body class the tag name. From 2 tags: portfolio and no-weblog, in the body class i see only no-weblog tag. If I try to write in css:
Quote:
body.no-weblog div.navigation-top{
display: none;
}
|
... doesn't work.
Last edited by gamix07; Oct 26, 2012 at 10:12 AM.
|
#9
Oct 26, 2012, 10:22 AM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
when I go to that link, the body statement is
HTML Code:
<body class="home page page-id-2 page-template page-template-TagPortfolio-php">
there is no tag-xxxxx class there.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#10
Oct 26, 2012, 10:29 AM
|
|
You need to acces one post: like this
You will see:
Quote:
single.single-post.postid-1787.single-format-standard.no-weblog
|
|
#11
Oct 26, 2012, 10:36 AM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
on that link I see
HTML Code:
<body class="single single-post postid-1787 single-format-standard no-weblog">
but for tags you should be seeing something like
HTML Code:
<body class="archive tag tag-frog tag-31">
I suggest you add some php 'echo' statements to see what is happening.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#12
Oct 26, 2012, 10:41 AM
|
|
I changed the code:
...and now you can see tag-no-weblog in page...hmmm
|
#13
Oct 26, 2012, 10:48 AM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
get rid of the slashes (////////////////) you put in the CSS insert, it is messing things up.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#14
Oct 26, 2012, 11:00 AM
|
|
You got right...pfff I wrong there by putting the slashes. I see now I resolve with tag-no-weblog to don't display the navigation-top, but it's a problem now:
On this PAGE LINK i got 3 tags: archiv, no-weblog, anthrophoscapes. The body class see only the specific tag "anthrophoscapes".... it's any chance to see all the tags?
And I tried to don't display the sidebar when the post got the tag no-weblog:
Quote:
body.tag-no-weblog td#left{
display: none;
}
|
...and doesn't work. All the elements looks terrible after this change.
Last edited by juggledad; Oct 26, 2012 at 12:05 PM.
|
#15
Oct 26, 2012, 12:13 PM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
You will have to play with your code. like I said, embed some php 'echo' statements and display the different variables so you can see what is happening.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
|