Edit the front page banner 'discover' & 'read more' buttons

GK User
Tue Dec 20, 2016 12:25 am
Hi there,

I can't find where to add the correct and working url or change the text for the Discover and Read More buttons that are on the first two sliders on the home page (inc Demo). I've created a third slider but not been able to recreate the buttons, so haven't any idea where they're controlled from.

Really lost on this one and appreciate your help.
User avatar
Expert Boarder

Joshua M
Tue Dec 20, 2016 12:37 am
Hi,

Please edit your slide page and check custom fields below the content. If these fields are not visible, please enable it from "screen option" (button on the top right corner).

You have to add custom field with name "slide_url" and value:
[Button Label]#YOUR_URL
User avatar
Moderator

GK User
Tue Dec 20, 2016 1:21 am
hooray!! thanks so much Joshua
User avatar
Expert Boarder

GK User
Tue Dec 20, 2016 1:36 am
unfortunately this has interfered with the href in the content as it is now pointing to page_url[Bookings]bookings/ which shows an error.
I've just removed the href from the code as the button does the job anyway but this may be an issue for others.
User avatar
Expert Boarder

Joshua M
Tue Dec 20, 2016 8:51 am
Could you please provide me with a backend access to your website, either here or via PM (click the “Private Message” text underneath my avatar) so that I may analyze it?
User avatar
Moderator

GK User
Wed Jan 04, 2017 12:10 am
Please see the attached image for a better idea of the problem
User avatar
Expert Boarder

Joshua M
Wed Jan 04, 2017 8:49 am
Please edit your wp-content/themes/Hotel/template.frontpage.php file and change the following fragment (line 95)
Code: Select all
$slide_url = esc_html(get_post_meta( $post->ID, 'slide_url', true ));

into:
Code: Select all
$slide_url = get_post_meta( $post->ID, 'slide_url', true );

                                $link_text = '';
                                // parsing custom texts
                                $link_match_text = array();
                               
                                if(preg_match('@^\[(.*?)\]@mis', $slide_url, $link_match_text) == 1) {
                                    $slide_url = preg_replace('@^\[.*?\]@mis', '', $slide_url);
                                    $link_text = $link_match_text[1];
                                } else {
                                    $link_text = __('Read more', 'photo');
                                }

We'll fix it with the next theme update. Thanks for your feedback.
User avatar
Moderator

GK User
Wed Jan 04, 2017 10:31 am
Well done! That resolved the content hyperlink issue. Can you please tell me how to fix the same problem with the 'page title' links? This is actually what we're using on this site, not the content as it's illegible - but someone somewhere will be using content links.
User avatar
Expert Boarder

Joshua M
Thu Jan 05, 2017 9:10 am
Are you sure, that you've edited template.frontpage.php file properly? I've checked and this fix works also for page titles of the slider. You can also send me a PM with FTP access, then I'll be able to check the issue.
User avatar
Moderator

GK User
Mon Jan 09, 2017 6:29 am
Hey Joshua, I emailed cPanel details on Friday. Can you please confirm that it was received as it's looking a little weird from this end and only showing up in the Outbox - not Sent box...
User avatar
Expert Boarder

Joshua M
Mon Jan 09, 2017 8:54 am
Hi,

Thanks, I've received the message (it stays in your outbox until I read it). I've checked your Hotel/template.frontpage.php file and you didn't add mentioned modification, I've added it and slide urls are generated properly now.
User avatar
Moderator

GK User
Tue Jan 10, 2017 1:56 am
Huh...! I definitely did make those modifications.... (??) but I gratefully appreciate you fixing that up...

...I wonder if there's some other file of the same name that I modified....
User avatar
Expert Boarder

Joshua M
Tue Jan 10, 2017 9:11 am
I've checked only Hotel/template.frontpage.php file and there's no other file with the same name within the Hotel directory.
User avatar
Moderator

GK User
Tue Jan 10, 2017 9:50 am
Thanks Joshua - maybe I never saved it!
User avatar
Expert Boarder


cron
Remember me
Register New Account
If you are old Gavick user, click HERE for steps to retrieve your account.