Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages »

Hide Navigation Top on all pages with a specific tag.


  #1  
Old Oct 24, 2012, 03:38 PM
gamix07
 
28 posts · Mar 2012
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  
Old Oct 24, 2012, 06:35 PM
juggledad's Avatar
juggledad
 
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  
Old Oct 25, 2012, 12:08 PM
gamix07
 
28 posts · Mar 2012
I make a screen to understand me better : Screen Here
  #4  
Old Oct 26, 2012, 08:43 AM
gamix07
 
28 posts · Mar 2012
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  
Old Oct 26, 2012, 09:37 AM
juggledad's Avatar
juggledad
 
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  
Old Oct 26, 2012, 09:59 AM
gamix07
 
28 posts · Mar 2012
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  
Old Oct 26, 2012, 10:03 AM
juggledad's Avatar
juggledad
 
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  
Old Oct 26, 2012, 10:09 AM
gamix07
 
28 posts · Mar 2012
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  
Old Oct 26, 2012, 10:22 AM
juggledad's Avatar
juggledad
 
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  
Old Oct 26, 2012, 10:29 AM
gamix07
 
28 posts · Mar 2012
You need to acces one post: like this
You will see:
Quote:
single.single-post.postid-1787.single-format-standard.no-weblog
  #11  
Old Oct 26, 2012, 10:36 AM
juggledad's Avatar
juggledad
 
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  
Old Oct 26, 2012, 10:41 AM
gamix07
 
28 posts · Mar 2012
I changed the code:
Quote:
$classes[]='tag-'.$slug;
...and now you can see tag-no-weblog in page...hmmm
  #13  
Old Oct 26, 2012, 10:48 AM
juggledad's Avatar
juggledad
 
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  
Old Oct 26, 2012, 11:00 AM
gamix07
 
28 posts · Mar 2012
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  
Old Oct 26, 2012, 12:13 PM
juggledad's Avatar
juggledad
 
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

Bookmarks

Tags
navigation links hide



Similar Threads
Thread Thread Starter Forum Replies Last Post
hide post-kicker on specific page cway Post-Kicker, -Byline & -Footer 9 Mar 21, 2012 04:32 PM
How to hide one specific category from posts page? unelma Center area post/pages 18 Feb 9, 2012 05:55 PM
How to hide a menu from specific pages? Sparklesperson Page & Category Menu Bars 5 Dec 29, 2011 10:45 AM
hide title on specific pages lambdaka Center area post/pages 0 Jul 10, 2010 10:25 AM
How do I hide a parent page in the top navigation bar freyakat Page & Category Menu Bars 1 Aug 26, 2009 07:29 PM


All times are GMT -6. The time now is 08:38 PM.


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