-
AuthorPosts
-
January 6, 2016 at 7:46 pm #560726
Hi
I run a website where we upload weekly podcasts. I’ve put the podcasts descriptions and feeds as a post and have changed the post “Read More” to “Listen to Podcast” in the loop-index.php
However we now want to post some articles too (see frontage of website) and the problem is if you click on a category e.g. articles or author it comes up with the right articles (posts) but they now have a link which says “Listen to Podcast” rather than “Read More”Is there a way to have “Read More” for the author and articles categories and keep the “Listen to Podcast” for the other podcast categories?
Not sure I’ve explained what I mean clearly enough but any help would be appreciated.
Thanks
AnjiJanuary 6, 2016 at 9:52 pm #560778Hey AnjiG!
Yes, you can create an is_category and use that, on category pages that are related to the podcast, else use the Read More.
https://codex.wordpress.org/Function_Reference/is_category
Let us know if you can understand the if statment you have to do and how it works
Best regards,
BasilisJanuary 6, 2016 at 9:55 pm #560779Hi Basilis
Not that knowledgeable I’m afraid. Happy to change php if necessary but would need to know what I need to add.
Thanks
AnjiJanuary 12, 2016 at 11:32 am #563807Hey!
Did you add any category to the podcast post? Did you set the Blog Content length to show the excerpt with the read more link? If yes, you can find this code around line 56:
$current_post['content'] = $blog_content == "excerpt_read_more" ? $current_post['content'].'<div class="read-more-link"><a href="'.get_permalink().'" class="more-link">'.__('Read more','avia_framework').'<span class="more-link-arrow"> →</span></a></div>' : $current_post['content'];
.. replace it with:
$readmore = has_category( 'podcast' ) ? __('Listen to Podcast','avia_framework') : __('Read more','avia_framework'); $current_post['content'] = $blog_content == "excerpt_read_more" ? $current_post['content'].'<div class="read-more-link"><a href="'.get_permalink().'" class="more-link">'.$readmore.'<span class="more-link-arrow"> →</span></a></div>' : $current_post['content'];
Replace the “has_category( ‘podcast’ )” value “podcast” with the category of the podcast posts.
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.