Tagged: Phone-Info, top bar
-
AuthorPosts
-
February 25, 2019 at 3:38 pm #1071312
Hi,
A client for whom I have to make a new website wants a text in the top bar which they can easily change themselves whenever and how often they want. Like the option phone-info, however this should be possible without giving them access to Enfold theme options.
Is this possible and how can I achieve this?
Thanks & regards,
MoniqueFebruary 25, 2019 at 5:01 pm #1071341You could use file_get_contents to open and read in an external file line by line and pass that to a string, then write that string into a custom div at the top of the website.
February 26, 2019 at 6:51 pm #1071915Thanks for your reply @DigitalEssence.
Unfortunately I am not a PHP programmer and I don’t understand how I can get this to work. It looks too complicated for me. When I try to understand a little bit what this is about, I get the impression that there should be a PHP file somewhere (functions.php?) in which my client can make changes to change the ‘hero’ text on their site. Normally such a file should be uploaded by ftp. My client doesn’t have these options available. There should be something in WordPress (outside the theme options) where they can change this text as often as they want.
February 26, 2019 at 6:59 pm #1071916Hi,
functions.php doesn’t exist by default, you have to create it in your child theme. You could either use and a hook that or copy header.php over from Enfold to your child and make your changes in there as this is the file that writes the header and the initial HTMl content where you would be placing a top bar..
But, if the client doesn’t have access to FTP and can’t upload a file then I think the only option would be to see if a plugin does what you need.
February 28, 2019 at 6:23 am #1072490Hi Monique,
Maybe you could try adding a widget area to the header? https://kriesi.at/documentation/enfold/header/#adding-a-header-widget-area
Thanks @DigitalEssence for helping out :-)
Best regards,
RikardFebruary 28, 2019 at 9:48 am #1072555Hi Rikard,
Thanks for your reply.
This site is already going to have an extra widget area for another purpose. It won’t be possible to add the ‘hero’ text there as well. Further my client wants the hero text in the left top bar.
Any more ideas?
Best regards,
MoniqueMarch 2, 2019 at 7:50 am #1073545Hi Monique,
You can add more than one widget to the header, just select a different name for your widgets. Then you can style them differently as well in order to display them in different locations.
Best regards,
RikardMarch 4, 2019 at 6:32 pm #1074472Hi Rikard,
Hmmm… I expect in that way the ‘hero’ text will be in the header and not in the top bar?If that is the case, the left top bar will be empty and the header will be overcrowded… Of course you can style anything, with negative top margins and so, but it is a lot of hassle and most probably you will not get a good result on all different devices…
Just an idea: is there perhaps a way to retrieve the general WordPress subtitle of the site (which is in WordPress General Settings) and to place this in the top bar? In that way my client will be able to change their text whenever they wish.
Or a notification bar or something alike?
Best regards,
Monique- This reply was modified 5 years, 8 months ago by Monique. Reason: new suggestion added
March 7, 2019 at 12:21 pm #1075949Hi,
Yes, that is possible. Create a custom shortcode base on the get_bloginfo function and then put that shortcode inside a text widget.
// https://developer.wordpress.org/reference/functions/get_bloginfo/
// https://codex.wordpress.org/Function_Reference/add_shortcodeThe code may look something like this:
add_shortcode( 'av_description_shortcode', 'av_description_shortcode_callback' ); function av_description_shortcode_callback() { $description = get_bloginfo('description'); return $description; }
Best regards,
IsmaelMay 14, 2019 at 5:55 pm #1100710Hi there,
We’ve found a work around to place the ‘hero’ text in the extra header widget of the site.
Please can you close this topic?
Thanks for your help & best regards,
MoniqueMay 15, 2019 at 7:43 am #1100872 -
AuthorPosts
- The topic ‘Top bar phone-info easy changeable by client’ is closed to new replies.