Problem with more link
-
Hi, I don’t know why it is not working. I have function where I change class according to category. And this function I need insert into more link of post in category. But class in link isn’t display. There is code:
function custom_color(){ if (in_category('exterier')) {echo 'green';} elseif (in_category('interier')) { echo 'cyan';} else echo 'default'; } function modify_read_more_link() { return '<a class="more-link' . custom_color() . '" href="' . get_permalink() . '">?íta? viac</a>'; } add_filter( 'the_content_more_link', 'modify_read_more_link' );
Thanks for help.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Problem with more link’ is closed to new replies.