By venkat-rk on
Is there some way to remove the link from the title of a sticky post? I know I can use the following css to remove *all* titles, but I want to retain the title links for all other posts.
Do I need to do this in the style.css of bluemarine or the page.tpl.php? I am using the php version of the bluemarine theme.
Comments
I added the following in
I added the following in node.tpl.php:
<?php if ($sticky) { ?><h2 class="title"><?php print $title?></h2><?php } ?>but the result was that I got another title below the original one, though without the link.
Hi Ramdak,
I think you are nearly there. I assume you put that line below the standard h2 title line in node.tpl.php.
Here is the logic I would use instead
If (sticky) { print only title} else {print normal title with link}
I would need to see your code for node.tpl.php to be more specific.
gpdinoz
"If you're not getting the answers you want maybe you're asking the wrong questions"
Regards
Geoff
Thank you, gpdinoz. You are
Thank you, gpdinoz. You are right. I put that line below the standard h2 title line.
I realised that it needs to be an if else statement, but I don't know how to combine the two. Here is the full code from my node.tpl.php:
This should work
Let me know if you have any problems with this.
This is a good idea. I will probably use this sometime in the future.
Regards
gpdinoz
"If you're not getting the answers you want maybe you're asking the wrong questions"
Regards
Geoff
Thanks!
Thanks!
But, it still prints out the double headline and retains the link. I noticed that, in page.tpl.php, there is only a h1 class, so I changed this to h1 in your code, but still no result. You can see it here.
www.ciosa.org.in/beta2
That is strange
I tested it on the bluemarine theme and taxonomy/term/6 page and it worked. What sort of posts page is it? Blog? story?Taxonomy?
Have you edited page.tpl.php? What modules have you got enabled?
gpdinoz
Thought for the day
"If you're not getting the answers you want maybe you're asking the wrong questions"
Regards
Geoff
It is a story content type
It is a story content type and it is on node, which I have designated as the front page of the site.
But, it is also tagged with taxonomy terms.
I didn't edit the page.tpl.php. Only did it on node.tpl.php? Could that be the reason?
Try this
gpdinoz
Thought for the day
"If you're not getting the answers you want maybe you're asking the wrong questions"
Regards
Geoff
This works great for me
... My stickys no longer have links.
But I'd like to add something to it but I don't know how. My page titles have links which seems completely unnecessary. Is there anyway to add something to this code that says that page titles will not have links as well as stickys but story and blog titles will?
Thanks,
Carey
I am sure what you want can
I am sure what you want can be done with some php code, but I still haven't learned enough to try:(
Very strange
You only need to edit node.tpl.php.
Have you used a php snippet to do this? what is the path (in the settings) to the node that you are using as the front page.
What version are you using?
I have accomplished exactly what you are trying to do on a couple of my test sites but it doesn't seem to work on your site so something must be different.
gpdinoz
"If we can see further it is because we stand on the shoulders of giants"
Regards
Geoff
Wow, your latest code works
Wow, your latest code works perfectly with the phptemplate version of bluemarine! Thanks a ton.
Apparently, you have to visit admin>>themes to get phptemplate to refresh its cache in order to recognise any changes to the .tpl.php files.
I just realised that this is an incredibly useful way to have an introductory paragraph for a taxonomy term page. Just change the node.tpl.php file, create a node, mark it sticky, tag it with a taxonomy term and you're done.
Thank you once again.
Great
I was starting to get worried.
Yes it is a great idea. I will definately be using this in the future.
gpdinoz
"If we can see further it is because we stand on the shoulders of giants"
Regards
Geoff