Jump to content

Add Shortcode for Button in Header

Recommended Posts

salestrakr    3

I currently use the BrandNav in Framework.  I would like to add a button at the top and to the right in the header.  I tried to add

<div style = "position: absolute; top: 20px; right: 0px;"> <?php
echo do_shortcode("[maxbutton id="3"]"); ?> </div>


to header.php.  However, this showed an error.  The shortcode is for a MaxButtons button.  Should I add this elsewhere?  If in header.php, where best to put it?


My site is http://trakrcrm.net. 

Share this post

Link to post
Share on other sites
catrina    103

Does the MaxButtons button require that you add extra code elsewhere? Also, what error are you getting?

Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post

Link to post
Share on other sites
salestrakr    3

MaxButtons provides a WP plugin.  Then you can put the shortcodes anywhere, or most anywhere HTML would be. 


Here is the error:  Parse error: syntax error, unexpected '<' in /nfs/c08/h02/mnt/152374/domains/trakrcrm.net/html/wp-content/themes/pagelines/header.php on line 43.


I've also use a button this way <a class="btn btn-warning btn-large" href="https://secure.salestrakr.com/signup/trial.html" target="_blank">Sign Up Now!</a>.  This is a Pagelines shortcode.  Could this be added to the header?



Share this post

Link to post
Share on other sites
batman    389


You can use a Hook to add the button to the header.

Please go to this topic 


to use a shortcode with a hook, you see the Evan Mattson´reply

Life is too short to remove USB safely ...

Share this post

Link to post
Share on other sites
Rob    547



Let me point out that editing header.php or any core files is unsupported and violates the support terms.  Please remove that code from the file as it will cause problems now and later.


To add PHP code to the branding area, as Batman correctly points out, you need to use a hook.


We have a free plugin called "Action Map" which will help you find the proper hook to use. Then, we also have a product called "Hooker" that will allow you to paste your code (once you know which hook to select).  It creates the code for you, so that you don't have to do more than look, select and paste.  Once saved, the hook is done and your shortcode will be functional where you want it.  Positioning it precisely is simply a matter of CSS.

Former PageLines Moderator, Food Expert and Raconteur

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

  • Similar Content

    • flourishdesignstudio
      By flourishdesignstudio
      I have an older site that was built using PageLines several years ago (prior to the release of DMS). I wanted to leverage some of the power of your new PL5 plugin but the theme prevents be from adding any generated custom sidebars to the theme (through the drag and drop interface) and does not allow me to add any PL5 sections/containers/etc to the header or footer. Is there any way to easily override that or am I stuck only using PL5 in the content areas of the site?
      Thanks so much for the help!
    • Samuel Costa - UDF
      By Samuel Costa - UDF+
      I need a shortcode activate a popup windows with contact form. It is possible without code?
      Link: https://www.udf.org.br/lancamentos/curso-mulher-que-prospera/
    • JP
      By JP+
      How can you set the translations with platform5, the parts that are not in pages or posts? Texts and images…
    • romanondrasek
      By romanondrasek
      hi all, I have some trouble using PL5 on my site. 
      I used plugins for event calendar (event on) and plugin (timetable responsive scheduler for WP) for schedule (classes) in the gym.
      The problem is, that post from this 2 plugins are shown without menu in header and footer. (I setup header and footer) in the page editor for all type of page. 
      When I create a lesson, it creates posts with slug (I have a slug "lekce" & event for events).
      I try to edit the post with PL editor, but editor is not opening on the post.

      Do you have some idea where should be some problem? Thanx so much.
      here are links for the sites :
      site with schedule :
      site of one of the class (pilates)
      site with calendar :
      7 side with one event from the calendar :
      when I have my site on DMS2 it was working :-(
    • Samuel Costa - UDF
      By Samuel Costa - UDF+
      i like to know if i can use signup button shortcode inside text editor or embed section.