OnPoint Plugins

  • Plugins
    • Advanced Sidebar Menu
    • Go Live Update Urls
  • About
    • Services
    • Showcase
  • Blog
  • Contact
  • Support
  • Log In
← Back to support

Display links with no web address as regular text

Resolved

Requested: 2 years and 7 months ago

Hi again Mat,

your plugin works fantastic but I have another issue.
There are some of the publications such in this page http://iqac.csic.inaudit.io/research/departments/surfactants-and-nanobiotechnology/surface-chemistry/#publications that has no links for the title, so I leave the web address option blank.

but it still have a link for the same page, how can I make there’s no link linked if there’s actually no link for the publication?

Thanks!

Pilar

Plugin: Simple Links

  1. OnPoint Plugins

    2 years and 7 months ago

    Hi Pilar,

    This may be accomplished by adding the following filter to your active theme’s functions.php file.

    add_filter( 'simple_links_link_output', 'no_link_text', 10, 3 );
    function no_link_text( $output, $data, $link ) {
       if ( empty( $data['web_address'][0] ) ) {
          return $link->post_title;
       }
    
       return $output;
    }

    Have a great day!

    Mat Lipe

  2. pilar

    2 years and 7 months ago

    Dear Mat,
    yes it worked!
    I think this will be the last question 😀
    I would like the titles of the links to be #cf1b15 in all the publications, for example here that there’s no link it’s not red:
    is it possible?
    thanks!

     

  3. OnPoint Plugins

    2 years and 7 months ago

    Hi Pilar,

    I have adjusted the filter to color the titles #cf1b5.

    add_filter( 'simple_links_link_output', 'no_link_text', 10, 3 );
    function no_link_text( $output, $data, $link ) {
       if ( empty( $data['web_address'][0] ) ) {
          return '<span style="color:#cf1b15">' . $link->post_title . '</span>';
       }
    
       return $output;
    }

    Have a great day!

    Mat Lipe

     

New Response Cancel reply

You must be logged in to respond. Only PRO members are allowed to respond to support requests.

© 2021 OnPoint Plugins · WordPress Development · Privacy Policy · Terms Of Service · Log in

  • Plugins
  • Blog
  • Contact