|
#1
![Old](images/bytesforall/statusicon/post_old.gif)
Jul 23, 2014, 03:57 AM
|
|
Hi, I am back to ask the great experts here! Currently I am using the kicker and footer info items to display the categories for each post. I am using the shortcode %categories-linked for this:
%categories-linked(', ')%
So each category gets a link in the kicker/footer, separated by a colon. Basically, this is what I want. However, there a a few categories I am using solely for technical reasons (images are displayed based on this category by using css and the like). I dont want these "ugly" technical categories to show up in the list of categories displayed by %categories-linked%. Is there a way to do that?
I have tried using css to apply "display: none;" to the category links in question, but it seems they dont have a special id or tag. All I came up with is:
.category-total-mg div.post-footer a:hover, div.post-footer a:link, div.post-footer a:visited, div.post-footer a:active {
display: none;
}
But of course this removes ALL category links in case the category is "total-mg", and not just the specific link to category "total-mg". Hope I am making myself clear...
|
#2
![Old](images/bytesforall/statusicon/post_old.gif)
Jul 23, 2014, 07:35 AM
|
![juggledad's Avatar](image.php?s=2462116c1dd3a6fd920510569989c342&u=675&dateline=1243595674) |
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
The answer is no...but
I dug thru the code to see if it could be changed to add a class to the <a> for each category, but the way the theme code is written, we call a wordpress function (the_category) and it returns a list of links to the categories.
Now there are a couple things that could be done.
1) edit the wordpress function to return the category as a class in the <a.....>
2) try coding a plugin to do what (1) would do
3) change the Atahualpa code to get the links differently and add in the class
any of the above might work but if you can't do it yourself, you going to have to pay someone to do the coding.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#3
![Old](images/bytesforall/statusicon/post_old.gif)
Jul 23, 2014, 06:35 PM
|
![juggledad's Avatar](image.php?s=2462116c1dd3a6fd920510569989c342&u=675&dateline=1243595674) |
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#4
![Old](images/bytesforall/statusicon/post_old.gif)
Jul 24, 2014, 12:22 AM
|
|
I think it would be a good solution, but unfortunately I also use my "ugly" categories for google analytics tracking (visits per category etc.). I use the Google Analytics for WordPress plugin by Joost de Valk for this, which uses the same WordPress function. If I hide the categories, I can no longer track them with GA... so this is no solution for me, I am afraid. Any other ideas?
I read somewhere in the BFA forums that you could theoretically insert a widget into the footer, then execute php in it (with a plugin), and so check for the categories.
Or alternatively there is a CSS function called after, which inserts text. If it is possible to insert a link with it, I could use CSS to insert links to categories into the kicker and footer if the post belongs to a certain category... sort of doing it the other way around.
Last edited by lmilesw; Jul 25, 2014 at 12:37 PM.
|
#5
![Old](images/bytesforall/statusicon/post_old.gif)
Jul 24, 2014, 03:03 AM
|
![juggledad's Avatar](image.php?s=2462116c1dd3a6fd920510569989c342&u=675&dateline=1243595674) |
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
Quote:
I think it would be a good solution, but unfortunately I also use my "ugly" categories for google analytics tracking (visits per category etc.). I use the Google Analytics for WordPress plugin by Joost de Valk for this, which uses the same WordPress function. If I hide the categories, I can no longer track them with GA... so this is no solution for me, I am afraid. Any other ideas?
|
If you hide the categories, how will you expect google to count them if they are hidden? I would expect Google to ignore/penalize hidden elements on a page.
Quote:
I read somewhere in the BFA forums that you could theoretically insert a widget into the footer, then execute php in it (with a plugin), and so check for the categories.
|
A long time age - before WordPress banned it - it was possible to put php in the theme options - BUT you can't anymore.
Quote:
Or alternatively there is a CSS function called after, which inserts text. If it is possible to insert a link with it, I could use CSS to insert links to categories into the kicker and footer if the post belongs to a certain category... sort of doing it the other way around.
|
None that I am aware of
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
Last edited by lmilesw; Jul 25, 2014 at 12:39 PM.
|
#6
![Old](images/bytesforall/statusicon/post_old.gif)
Jul 27, 2014, 06:37 AM
|
|
I have found a simple solution :-)
Instead of trying to adapt the function displaying ALL categories, I went at it from the other side. I thought: All I want to do is display a list of categories - those which are useful to the user, not ALL categories.
So I edited the post info items, manually adding links for the categories I want, and giving them CSS classes so I could select them later with CSS commands.
Letīs say my categories are called "category1", "category2" etc. by wordpress. So I did this in the footer info items:
<span id="mycategory1"><a href:/link/to/wordpress/category1/ ...</a></span>
.. mycategory2 ...
etc.
then, in the CSS inserts, I added "display: none;" for all of these links:
#mycategory1 {
display: none;
}
So by default the links are there, but are not displayed. Crazy, eh?
Now I added another CSS item:
.category-category1 div.post-footer #mycategory1 {
display: inline;
}
and so on for all categories I created links for
The effect is that in posts which belong to category1, the CSS unhides the link by applying "display: inline,". In all other posts, the link stays hidden.
By this, I manage to create a footer which displays only the category links I need, and ONLY if the post belongs in the category.
Maybe this will be of help to somebody oneday, so if yes, please feel free to use it; hope I managed to explain the procedure properly.
Last edited by Jerry_Q4d; Jul 27, 2014 at 06:41 AM.
|
#7
![Old](images/bytesforall/statusicon/post_old.gif)
Sep 2, 2014, 12:45 AM
|
|
I have noticed a strange thing: since the last Atahualpa update the code is broken. Maybe this is a bug in the last version. Apparently, the body of the whole site now gets the categories of the first post (on multi post pages). Dont know if it is just happening for me or always.
The result is that if you query the categories with css and show links for the appropriate categories of a post, you are always showing the categories of the first post also, which kind of breaks the whole idea. Is it something I can correct or is it an Atahualpa thing?
|
#8
![Old](images/bytesforall/statusicon/post_old.gif)
Sep 2, 2014, 04:03 AM
|
![juggledad's Avatar](image.php?s=2462116c1dd3a6fd920510569989c342&u=675&dateline=1243595674) |
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
A new feature was added in 3.7.17 to add the categories names to the body on single post pages. It does this by testing to see if the page is an archive pages (any multi post page). If so, it does not add the category names to the <body> statement.
Turns out that if you show your posts on the landing page, it is not considered an archive page like all other multi post pages.
see PATCH 3718-01: <body> statement shows category named when blog page is front page for a fix
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#9
![Old](images/bytesforall/statusicon/post_old.gif)
Sep 2, 2014, 06:55 AM
|
|
Wow that was fast. You are great as always.
|
Similar Threads
|
Thread |
Thread Starter |
Forum |
Replies |
Last Post |
Author avatar in kicker/footer?
|
Danielwerner |
Post-Kicker, -Byline & -Footer |
2 |
Aug 24, 2013 05:49 PM |
[SOLVED] Exclude date (in kicker) in all categories except one
|
farmal |
Post-Kicker, -Byline & -Footer |
2 |
Sep 26, 2010 04:53 PM |
Put AddThis in Kicker or Footer
|
nick51 |
Post-Kicker, -Byline & -Footer |
8 |
May 12, 2010 08:12 AM |
PHP goodies for kicker/footer?
|
paulae |
Post-Kicker, -Byline & -Footer |
5 |
Oct 14, 2009 08:13 AM |
Category title on category page, not on each post excerpt kicker
|
paulae |
Excerpts, Read more, Pagination |
4 |
Jun 22, 2009 11:33 AM |
|