WordPress.org

Ready to get started?Download WordPress

Forums

Customizr
[resolved] link featured text homepage (17 posts)

  1. apestaartje
    Member
    Posted 4 months ago #

    Hi,
    I want to know how to make hyperlinks on the featured texts on the homepage.
    Thanks.

  2. d4z_c0nf
    Member
    Posted 4 months ago #

    Do you mean make the text of the featured pages a link? And the same link of the button?

  3. apestaartje
    Member
    Posted 4 months ago #

    I want to make multiple hyperlinks on texts above the buttons.

  4. saramenc
    Member
    Posted 4 months ago #

    I'd just have the same question to ask. Has Featured Pages this custom property?

  5. d4z_c0nf
    Member
    Posted 4 months ago #

    You can try adding this to your child-theme functions.php

    add_filter('tc_fp_text_sanitize', 'no_sanitize_text', 20, 3);
    function no_sanitize_text($text, $fp_single_id, $fp_id){
        // grab the original text and leave the filter hook on it
        $featured_text = apply_filters( 'tc_fp_text', tc__f( '__get_option' , 'tc_featured_text_'.$fp_single_id ), $fp_single_id, $fp_id );
        // return un-sanitized text with html tags
        return html_entity_decode($featured_text);
    }

    This way you can use html entities in the fp-text.
    Look that this will work just with featured text set in customizr settings, will not work if you use the automatic excerpt of the selected page.

  6. saramenc
    Member
    Posted 4 months ago #

    would it work the same with the title or the featured image?

  7. d4z_c0nf
    Member
    Posted 4 months ago #

    Sorry don't get what do you mean :D
    This is in order to have html entities in featured pages text.
    What do you mean?

  8. apestaartje
    Member
    Posted 4 months ago #

    Ok, I've added this to functions.php (I don't use a child theme).
    How can I make the hyperlinks now?

  9. d4z_c0nf
    Member
    Posted 4 months ago #

    Well you should use a child-theme, otherwise you'll lose your changes in the functions.php of customizr on every upgrade.
    But it's up to you.
    What you have to do now is simply put html tags in the featured pages text in customizr settings.
    Something like

    blablabla <a href="http://www.whatever.com"> Go to whatever </a>
  10. apestaartje
    Member
    Posted 4 months ago #

    Yes, that works, thanks a lot!
    Now it's my task to limit the 200 available characters of every featured text :-)

  11. saramenc
    Member
    Posted 4 months ago #

    Sorry, I intended: what if I want to have the same hyperlink of button on title or image instead of excerpt (text)? Can I use the same code?

  12. csingerline
    Member
    Posted 4 months ago #


  13. rdellconsulting
    Member
    Posted 4 months ago #

    @csingerline, I answered your other post. Please don't hijack other non-related posts. I do understand your feeling of panic at the moment.

    Unless this was the change you were trying to make?

    (Post has been deleted and moved to another post!)

  14. d4z_c0nf
    Member
    Posted 4 months ago #

    Guys this is the topic of apestaartje .
    So. (I thought there was a snippet for this, I couldn't find it .. :()

    //change fp_text_length
    add_filter('tc_fp_text_length', 'my_fp_length');
    function my_fp_length(){
        return 500;
    }
  15. apestaartje
    Member
    Posted 4 months ago #

    If you mean I can choose 500 - or less or more - characters I would be happy. Thanks again.

  16. d4z_c0nf
    Member
    Posted 4 months ago #

    Yes I meant that, change that 500 to suit your needs, let me know if something goes wrong.

  17. apestaartje
    Member
    Posted 4 months ago #

    OK. It works, keep up the good work!

Reply

You must log in to post.

About this Theme

About this Topic