Keyword

How to remove just the Authors Link on a Category Page...

  • Chris Hogan
  • Chris Hogan's Avatar Topic Author
  • Offline
  • Premium Member
More
4 years 9 months ago #172571 by Chris Hogan
Hi there,

As I have no authors (officially) setup I have no need for the Authors Names to be linkable...but I do still want them to be shown!

As far as I know the only options in the 'main parameters' and in the 'display settings' of my categories there is no option to remove this link to an authors name.

Hope this makes seen what I am trying to achieve.
Let me know if possible because at present when an Author is clicked it reverts to the homepage!

Thanks in advance
Attachments:

Please Log in or Create an account to join the conversation.

  • Chris Hogan
  • Chris Hogan's Avatar Topic Author
  • Offline
  • Premium Member
More
4 years 9 months ago #172585 by Chris Hogan
Any thoughts...on how to achieve this?

Please Log in or Create an account to join the conversation.

More
4 years 9 months ago #172588 by Dejan Bojovic
In category_item.php remove

<?php if(isset($this->item->author->link) && $this->item->author->link): ?>
<a rel="author" href="<?php echo $this->item->author->link; ?>"><?php echo $this->item->author->name; ?></a>

Please Log in or Create an account to join the conversation.

More
4 years 9 months ago #172623 by JoomlaWorks
@Dejan is correct.

But out of curiosity, why would you want to remove that? It's handy to be able to list all K2 items from a certain user. The other quick tip I would add is to use the "author alias" which would output static text only (no link).

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Chris Hogan
  • Chris Hogan's Avatar Topic Author
  • Offline
  • Premium Member
More
4 years 9 months ago #172650 by Chris Hogan
Hi Guys,

I removed all that code and got major errors on page, I also tried removing each line then tested various other parts...and the best I've managed to do was to make it unclickable (even though it still looks like a link!)

I did this by removing this part of the second line of code:
href="<?php echo $this->item->author->link; ?>

Any ideas how to remove the part which makes it look linkable?

Thankyou!

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #172666 by JoomlaWorks
You probably broke your HTML layout or PHP removing code. In order to give you the correct answer, you need to paste back your item.php code, cause if your template uses K2 overrides, the output may be slightly different from the stock K2 template files.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Chris Hogan
  • Chris Hogan's Avatar Topic Author
  • Offline
  • Premium Member
More
4 years 8 months ago #172690 by Chris Hogan
The page is no longer broken, just need advise on removing the link from this code:

<?php if(isset($this->item->author->link) && $this->item->author->link): ?>
<a rel="author" href="<?php echo $this->item->author->link; ?>"><?php echo $this->item->author->name; ?></a>

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #172692 by JoomlaWorks
Change this:
<?php if(isset($this->item->author->link) && $this->item->author->link): ?>
<a rel="author" href="<?php echo $this->item->author->link; ?>"><?php echo $this->item->author->name; ?></a>

to this:
<?php if(isset($this->item->author->link) && $this->item->author->link): ?>
<?php echo $this->item->author->name; ?>

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum