• 0
Sign in to follow this  
Followers 0

How to add message at the top of home page

Question

Posted · Report post

My site works really poorly when a user is using a VPN. I would like to display this at the top of the homepage. How can I add a message at the top of the page. I have tried doing with the the callout, but could not get it to work. It just needs to be simple text to let users know. Thanks.

Share this post


Link to post
Share on other sites

7 answers to this question

  • 0

Posted · Report post

You can add a message using a hook, which is implemented in the functions.php file in either the base theme ([url="http://www.pagelines.com/wiki/How_to_Use_the_Base_Theme"]explained here[/url]) or the PageLines Customize plugin ([url="http://www.pagelines.com/wiki/How_to_Use_the_PageLines_Customize_Plugin"]explained here[/url]). If you're not using either of these already, you'll need to install one of them first. CSS can be used to give the message its style (font style, size, color, etc.), but you can worry about that last (after you've implemented the hook). Custom CSS is explained here: http://www.pagelines.com/wiki/Custom_CSS. Further documentation on CSS attributes is here: http://w3schools.com/css/default.asp

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hey Catrina. I have the base theme installed. Thanks for the links! After following the links, I am trying to learn what a hook is and how to write one. I found this :http://www.pagelines.com/wiki/Hooks , but was wondering if you could recommend any other resources that explain hooks more in depth. Thanks a ton!

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hi Highreach, I have provided you with a link to the Wordpress Codex that has more information regarding Hooks. http://codex.wordpress.org/Plugin_API Below is an example: [code]// add_action('hook_name','function name'); add_action('pagelines_branding_icons_end', 'add_icons_to_branding'); // function name function add_icons_to_branding(){ // what the function does ?>[/code] The below code adds an image to the header of your section. [code]add_action('pagelines_before_branding_icons','custom_image'); function custom_image(){ ?>

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Danny, thanks for the info. I read through that link, though I must admit most of this coding is very foreign to me. This is what I came up with: add_action('pagelines_before_branding_icons','text'); function text(){ ?>
editor>functions.php. I am not totally sure where I should add my code. My guess is that it would be between the dashed lines where it says "// = YOUR FUNCTIONS - Where you should add your code =" and put it after the equal sign, but definitely not something I want to get wrong and break. Also, Is there a way to edit the html of the site? I think that would be an easier way to try and add a line of plain text at the top of the site. Thanks a bunch.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

First, you need to add the PageLines Customize plugin available via the Store (Dashboard > PageLines > Store > Plugins > Top Free). Then you can use Dashboard > Plugins > Editor > Pagelines Customize to select and edit functions.php in the plugin. Here's a bit of code that should work. [code]add_action('pagelines_before_branding_icons','custom_text'); function custom_text(){ ?>
This site will load much faster if you do not use a VPN.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

I downloaded the pagelines customize plugin and my code looks like the following: } /* // ==================================================== // = YOUR FUNCTIONS - Where you should add your code = // ==================================================== */add_action('pagelines_before_branding_icons','custom_text'); function custom_text(){ ?>
This site will load much faster if you do not use a VPN.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Did you add CSS styling for the custom_text
layer? Maybe it's hiding somewhere but the CSS styling isn't allowing it to show.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0