Wellbeingcampus Posted February 2, 2022 Share Posted February 2, 2022 Site URL: https://wellbeingcampus.com.au Hello, I've searched through past posts and the codes are not working for my site. I have two issues. I am trying to change the title of the drop down box in the navigation/header to clickable. This has never worked for my site, so have I have had to change the title to something different so it's not repeated and confusing for people. Secondly, I would like to add my phone number to the header. Would anyone know how to do this? I've tried two codes (from searching old posts) and neither are working. Phone number is 1300 188 575 Thanks heaps in advance for your help! Link to comment
tuanphan Posted February 7, 2022 Share Posted February 7, 2022 #1. Add to Last Line in Settings > Advanced > Code Injection > Footer <script> $(document).ready(function() { // about $('a.header-nav-folder-title[href="/about-1"]').click(function() { var link = $(this).text(), href = "https://google.com"; window.location.href=href; }); // mental health $('a.header-nav-folder-title[href="/mental-health-first-aid"]').click(function() { var link = $(this).text(), href = "https://facebook.com"; window.location.href=href; }); // individuals $('a.header-nav-folder-title[href="/individuals-1"]').click(function() { var link = $(this).text(), href = "https://pinterest.com"; window.location.href=href; }); // FAQs $('a.header-nav-folder-title[href="/faqs-1"]').click(function() { var link = $(this).text(), href = "https://instagram.com"; window.location.href=href; }); }); </script> #2. Phone is clickable or non-clickable? Phone next to button or? Hide phone on mobile or? Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
Wellbeingcampus Posted February 11, 2022 Author Share Posted February 11, 2022 Thanks so much. All seem to work except for the Mental Health First Aid title, I'm unsure why. In terms of the phone number, I would just like it listed in the header somewhere, perhaps under the Book a Course button. It doesn't need to be clickable. Link to comment
tuanphan Posted February 14, 2022 Share Posted February 14, 2022 On 2/11/2022 at 7:25 AM, Wellbeingcampus said: Thanks so much. All seem to work except for the Mental Health First Aid title, I'm unsure why. In terms of the phone number, I would just like it listed in the header somewhere, perhaps under the Book a Course button. It doesn't need to be clickable. I just checked your site & found you used another code, not my code to add click. You should contact the code author. It looks like your code by @creedon, .. <script> $( ( ) => { /* begin make navigation folder URL Slugs clickable SS Version : 7.1 */ const folderToPageUrlSlugMap = { /* adding lines here is optional, when no lines are added the folder will link to the first page in the folder the format of each line is a folder page URL Slug and a destination page URL Slug for each folder page copy value from Folder Settings > General > URL SLUG field. you only need exactly what can be selected from the field for each destination page copy value from page Settings > General > URL SLUG field. you only need exactly what can be selected from the field */ // '[enter folder page url slug here]' : '[enter page url slug here]', 'mhfa' : 'mental-health-first-aid', } // do not change anything below, there be the borg here if ( ! Object.keys ( folderToPageUrlSlugMap ).length ) { $( '.header-nav-folder-title' ).each ( function ( ) { const key = $( this ) .attr ( 'href' ) .slice ( 1 ); folderToPageUrlSlugMap [ key ] = ''; } ); } const keys = Object.keys ( folderToPageUrlSlugMap ); $.each ( keys, function ( i, key ) { let url = folderToPageUrlSlugMap [ key ]; if ( url ) if ( ! url.includes ( '://' ) ) url = '/' + url; $( '.header-nav-folder-title[href="/' + key + '"]' ).each ( function ( ) { const $this = $( this ); let $c = $this .clone ( ) .removeAttr ( 'id' ); if ( $c.hasClass ( 'preFade' ) ) $c.addClass ( 'fadeIn' ); if ( url ) $c.attr ( 'href', url ); $this.replaceWith ( $c ); } ); } ); // end make navigation folder URL Slugs clickable } ); </script> Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment