Title: Make FP Titles Clickable
Last modified: August 22, 2016

---

# Make FP Titles Clickable

 *  Resolved [David_G](https://wordpress.org/support/users/questas_admin/)
 * (@questas_admin)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/make-fp-titles-clickable/)
 * Is there any way to make the Featured Page Titles Clickable/linkable?

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

 *  [Rocco Aliberti](https://wordpress.org/support/users/d4z_c0nf/)
 * (@d4z_c0nf)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/make-fp-titles-clickable/#post-5545022)
 * We already had this discussion 😛
    [https://wordpress.org/support/topic/make-feature-page-titles-hyper-text-clickable?replies=12](https://wordpress.org/support/topic/make-feature-page-titles-hyper-text-clickable?replies=12)
   But.. better versions of those snippets could be:
 *     ```
       add_filter('tc_fp_single_display', 'add_title_link', 20, 6);
       function add_title_link($html, $fp_single_id, $show_img, $fp_img, $featured_page_link, $featured_page_title){
           $link = '<a href="'.$featured_page_link.'">'.$featured_page_title.'</a>';
           return preg_replace('/<h2>'.$featured_page_title.'(.*?)<\/h2>/', '<h2>'.$link.'$1</h2>',$html);
       }
       ```
   
 * and for the js (which should be compatible also with fpu extension.. maybe):
 *     ```
       add_action('wp_footer', 'fp_titles_linkizr', 200);
       function fp_titles_linkizr(){
           if ( ! tc__f('__is_home') )
               return;
       ?>
           <script type="text/javascript">
               jQuery(document).ready(function () {
                   !function ($){
                       "use strict";
                        // grab all a .round-div
                       var $round_divs = $("a").filter(".round-div");
                       // grab all fp-titles
                       var $titles = $(".widget-front > :header");
   
                       $titles.each( function(i) {
                           var $edit_span = $(this).find('span');
                           $edit_span.detach();
                           // let's wrap the title into the round-div link
                           var linkizd_title = '<a href="' + $( $round_divs[i] ).attr('href') + '" title="' + $( $round_divs[i] ).attr('title') + '">' + $(this).html() + '</a>';
                           $(this).html(linkizd_title);
                           $(this).append($edit_span);
                       });
                   }(window.jQuery);
               });
           </script>
       <?php
       }
       ```
   
 * edit: in the js take care of the edit button when in admin mode.
 *  Thread Starter [David_G](https://wordpress.org/support/users/questas_admin/)
 * (@questas_admin)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/make-fp-titles-clickable/#post-5545026)
 * I forgot I did ask about that before. Short memory I guess. Thanks for responding.
 * D
 *  [Rocco Aliberti](https://wordpress.org/support/users/d4z_c0nf/)
 * (@d4z_c0nf)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/make-fp-titles-clickable/#post-5545027)
 * 😀
    ps js code edited/updated
 *  Thread Starter [David_G](https://wordpress.org/support/users/questas_admin/)
 * (@questas_admin)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/make-fp-titles-clickable/#post-5545029)
 * Thanks
 *  Thread Starter [David_G](https://wordpress.org/support/users/questas_admin/)
 * (@questas_admin)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/make-fp-titles-clickable/#post-5545118)
 * Now I do remember, couldn’t get it to work then either. Still not working.
 *  [Rocco Aliberti](https://wordpress.org/support/users/d4z_c0nf/)
 * (@d4z_c0nf)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/make-fp-titles-clickable/#post-5545119)
 * Which one?
    js or the other one? Are you using a fp plug in? Also, can I see 
   your site? Thanks.
 *  [Rocco Aliberti](https://wordpress.org/support/users/d4z_c0nf/)
 * (@d4z_c0nf)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/make-fp-titles-clickable/#post-5545128)
 * Anyway you said in that post:
    “Fantastic, That worked GREAT… Thank You.” so,
   or you lied then or you’re lying now saying you remember you couldn’t get it 
   to work, or your memory is very short :P. Plus I remember I checked if it was
   working on your site, I always do this check when people provide a website. Since
   then some changes have been made in fpu plugin
 *  [Rocco Aliberti](https://wordpress.org/support/users/d4z_c0nf/)
 * (@d4z_c0nf)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/make-fp-titles-clickable/#post-5545130)
 * This is the js version which should take care about fpu plugin:
 *     ```
       add_action('wp_footer', 'fp_titles_linkizr', 200);
       function fp_titles_linkizr(){
           if ( ! tc__f('__is_home') )
               return;
           $widget_front = class_exists('TC_fpu') ? "fpc-widget-front" : "widget-front";
       ?>
           <script type="text/javascript">
               jQuery(document).ready(function () {
                   !function ($){
                       "use strict";
                        // grab all a .round-div
                       var $round_divs = $(".<?php echo $widget_front; ?> a").filter(".round-div");
                       // grab all fp-titles
                       var $titles = $(".<?php echo $widget_front; ?> > :header");
   
                       $titles.each( function(i) {
                           var $edit_span = $(this).find('span');
                           $edit_span.detach();
                           // let's wrap the title into the round-div link
                           var linkizd_title = '<a href="' + $( $round_divs[i] ).attr('href') + '" title="' + $( $round_divs[i] ).attr('title') + '">' + $(this).text() + '</a>';
                           $(this).html(linkizd_title);
                           $(this).append($edit_span);
                       });
                   }(window.jQuery);
               });
           </script>
       <?php
       }
       ```
   
 * edit: use widget front selectors
 *  [Rocco Aliberti](https://wordpress.org/support/users/d4z_c0nf/)
 * (@d4z_c0nf)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/make-fp-titles-clickable/#post-5545131)
 * Since fpu APIs are different than customizr fp ones, and assuming they’re not
   changed since fpu 1.13 (this is the last version I have)..
    ..This should be 
   the “filter” version for fpu:
 *     ```
       add_filter('fpc_single_display', 'add_fpc_title_link', 20, 5);
       function add_fpc_title_link($html, $fp_single_id, $fp_img, $featured_page_link, $featured_page_title){
           $link = '<a href="'.$featured_page_link.'">'.$featured_page_title.'</a>';
           return preg_replace('/<h(.*?)>'.$featured_page_title.'(.*?)<\/h(.*?)>/', '<h$1>'.$link.'$2</h$1>',$html);
       }
       ```
   
 *  Thread Starter [David_G](https://wordpress.org/support/users/questas_admin/)
 * (@questas_admin)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/make-fp-titles-clickable/#post-5545197)
 * My very **HUMBLE APOLOGIES**, Your right it did work then, I will definately 
   take that statement back. Sorry I didn’t get back here sooner to make things 
   right.
    I can’t seem to get it to work now however. I did change it to “fpc” 
   from the beginning as I am using FPU. I am wondering if it has to do with my 
   customization of the Title Text. I haven’t tried the latest snippets you posted
   yet.
 *  Thread Starter [David_G](https://wordpress.org/support/users/questas_admin/)
 * (@questas_admin)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/make-fp-titles-clickable/#post-5545198)
 * OK just added those snippets, they work PERFECTLY.
 * Again Thank You and my sincere apologies.
 * D
 *  [Rocco Aliberti](https://wordpress.org/support/users/d4z_c0nf/)
 * (@d4z_c0nf)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/make-fp-titles-clickable/#post-5545201)
 * No dear questas_admin, no need to apologize, it’s my fault. I’ve been rude, sometimes
   happens (I am irritable and touchy :P), sorry.
    Glad to hear you solved. I see
   you are using the javascript version, what about the one which uses the filter?
   Doesn’t work? Let me know, when you can. Cheers
 *  Thread Starter [David_G](https://wordpress.org/support/users/questas_admin/)
 * (@questas_admin)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/make-fp-titles-clickable/#post-5545202)
 * We both must have been grumpy that day. I was getting rather frustrated myself.
   It seemed nothing was working correctly that day from computers, trucks, weather
   and the final breaking straw a **teenage brat**!
 * Anyway, both codes work great. I just tried the js version last.
 * Cheers Back.
 *  [Rocco Aliberti](https://wordpress.org/support/users/d4z_c0nf/)
 * (@d4z_c0nf)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/make-fp-titles-clickable/#post-5545228)
 * Ehehe 😀

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

The topic ‘Make FP Titles Clickable’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/customizr/4.4.24/screenshot.png)
 * Customizr
 * [Support Threads](https://wordpress.org/support/theme/customizr/)
 * [Active Topics](https://wordpress.org/support/theme/customizr/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/customizr/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/customizr/reviews/)

 * 14 replies
 * 2 participants
 * Last reply from: [Rocco Aliberti](https://wordpress.org/support/users/d4z_c0nf/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/make-fp-titles-clickable/#post-5545228)
 * Status: resolved