• Resolved genepine

    (@genepine)


    I’m having trouble inserting a custom template file of “get_category_link” .

    I wrote the template source below…

    // Show category link:

      $lcp_display_output .= '<span class="entry-meta_items entry-meta_items_term">';
      $lcp_display_output .= $this->get_category_link('a', ' btn btn-xs btn-primary');
      $lcp_display_output .= '</span></div>';

    I want to set three class at a tag but can’t.
    hope
    <a class="btn btn-xs btn-primary" href="httpX://XXXXXX.XXXXXX/category/schedule/ongoing" title="ONGOING">ONGOING</a>

    result of a tag is NULL and wrong.

    <span class="entry-meta_items entry-meta_items_term">
    <a class="btnbtn-xsbtn-primary"></a>
    <a href="httpX://XXXXX.XXXXX/category/schedule/ongoing" title="ONGOING">ONGOING</a>

    Does anyone know solve the problem, please let me know.Thanks.

    • This topic was modified 8 years, 4 months ago by genepine.
    • This topic was modified 8 years, 4 months ago by genepine.
    • This topic was modified 8 years, 4 months ago by genepine.
    • This topic was modified 8 years, 4 months ago by genepine.
    • This topic was modified 8 years, 4 months ago by genepine.
    • This topic was modified 8 years, 4 months ago by genepine.
    • This topic was modified 8 years, 4 months ago by genepine.
    • This topic was modified 8 years, 4 months ago by genepine.
    • This topic was modified 8 years, 4 months ago by genepine.
    • This topic was modified 8 years, 4 months ago by genepine.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor zymeth25

    (@zymeth25)

    You cannot do it like this, the arguments you pass (tag and class) are used to wrap the category link, not to alter it.

    There is a workaround you can try though:

    
    $lcp_display_output .= '<span class="entry-meta_items entry-meta_items_term">';
    $catlink = $this->get_category_link();
    $lcp_display_output .= substr_replace($catlink, ' class="btn btn-xs btn-primary"', 2, 0);
    $lcp_display_output .= '</span></div>';
    
    Thread Starter genepine

    (@genepine)

    I’m very grateful for your solution(that is advanced code for me…)!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Set three class at “get_category_link” of template’ is closed to new replies.