• Hi,

    For some reason hyperlinks that I added in the first chapter of my post (that is visible in the excerpt on the frontpage) won’t show. Also custom css like bold text or different colors don’t seem to work.

    Any fix for this issue?

    Regards,

    Quizel

Viewing 5 replies - 1 through 5 (of 5 total)
  • Theme Author CrestaProject

    (@crestaproject)

    Hi quizel,
    strange, can you link me your website?

    Best Regards,
    CrestaProject

    Thread Starter quizel

    (@quizel)

    Hi,

    The domain I am currently testing it on is: https://goo.gl/xSEfGB

    I don’t have any other plugins running at the moment so it’s not cache related or something like that.

    Regards,

    Quizel

    Theme Author CrestaProject

    (@crestaproject)

    Hi quizel,
    hyperlinks and custom styles are not displayed in the “excerpt”, these things are displayed in the “content”.

    The “excerpt” is limited only to show a brief summary of the posts without using any graphic style.

    Best,
    CrestaProject

    Thread Starter quizel

    (@quizel)

    Hi,

    Since my previous theme had this feature that it would show graphic styles, hyperlinks, etc within the excerpt I thought it was a default feature.

    Is this something you are willing to add to the theme in the future or do you have any idea how I can solve this myself?

    Regards,

    Quizel

    Theme Author CrestaProject

    (@crestaproject)

    Hi quizel,
    probably your previous theme used “the_content()” function (or a custom function) instead of “the_excerpt()” to show the summary.
    That’s why you saw hyperlinks, graphic style, etc …

    It’s not a problem or a bug, it’s a different approach ??

    If you want to use “style” in the excerpt, you should create a custom function like this:

    function content($limit) {
      $content = explode(' ', get_the_content(), $limit);
      if (count($content)>=$limit) {
        array_pop($content);
        $content = implode(" ",$content).'...';
      } else {
        $content = implode(" ",$content);
      }
      $content = preg_replace('/\[.+\]/','', $content);
      $content = apply_filters('the_content', $content);
      $content = str_replace(']]>', ']]>', $content);
      return $content;
    }

    In this way you can use:

    content(20);

    insted of “the_excerpt”.

    I have not checked the code, I got it from this post: https://smallenvelop.com/4-ways-to-limit-post-excerpt-length-in-wordpress/

    Best,
    CrestaProject

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Hyperlinks custom css not working in excerpt’ is closed to new replies.