Jump to content


Photo
- - - - -

Donate Button in Fixed Navbar

fixed navbar customize

Best Answer Danny , 02 October 2013 - 11:17 AM

Sorry the code I gave you is wrong.

Replace #page 

 

With #site

Go to the full post


  • Please log in to reply
19 replies to this topic

#1 sethoof

sethoof

    Super Member

  • Members

  • 100 posts
  • Country: Country Flag

Posted 26 September 2013 - 05:41 PM

My charity made the conversion to Pagelines just before the DMS launch and I need to add a "donate" button (small .png tht links to another page) into the fixed navigation bar.  But I am not sure where to add the code.  Can you help?

 

Site is www.opfistula.org

 

Thanks in advance for your help!



#2 James B

James B

    Advocate

  • Members

  • 5126 posts
  • LocationSurrey - UK
  • Country: Country Flag

Posted 27 September 2013 - 12:32 AM

Hi there,

 

The easiest way to do this inside the framework would be to use a hook, details on how to do this can be found on http://forum.pagelin...cons-in-header/. You'll need either the base theme or customize plugin active on the site to paste the code into the functions.php.



#3 sethoof

sethoof

    Super Member

  • Members

  • 100 posts
  • Country: Country Flag

Posted 27 September 2013 - 08:33 AM

Hi, Thanks for the quick answer.  I am not very familiar with using hooks, especially in pagelines.  And several of the links in the post you referred me to are dead (http://api.pagelines.com/hooks) & (http://www.pagelines.com/wiki/How_to_Use_the_PageLines_Customize_Plugin).  From other searches I have done on the forum, it looks like the only way to make changes inside the fixed nav bar is with the get_search_form hook.  So I can start to figure out how to play with that.  But I am not sure where to put any code.   I tried to install the Pagelines Customize plugin in the store, but I got this message " Fatal error! The package could not be installed. PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature"  Please advise.



#4 Danny

Danny

    Is Awesome!

  • Moderators
  • 17580 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 27 September 2013 - 09:15 AM

You can use the following code as a base to add your own button.

 add_action( 'pagelines_navbar_before_menu', 'dontate_button' );
 
function dontate_button()  { ?>
 
<a class="btn btn-primary btn-small" href="#">Dontate</a>
    
    <?php
    
}

 

Please be aware that you may need to use additional styling.



#5 sethoof

sethoof

    Super Member

  • Members

  • 100 posts
  • Country: Country Flag

Posted 27 September 2013 - 09:51 AM

ok, I will give this a try.  But where shall I put it? In the Custom Code Section?? Is the Pagelines Customize plugin no longer available?



#6 Jake

Jake

    Advocate

  • Premium
  • 565 posts
  • LocationNC, USA
  • Country: Country Flag

Posted 27 September 2013 - 01:50 PM

Hi @sethoof - The customize plugin is still available if you'd prefer that method, it can be downloaded from http://launchpad.pag...s-customize.zip. Otherwise, to enter your custom functions with a base theme activated you would navigate to Appearance - Editor - functions.php.



#7 sethoof

sethoof

    Super Member

  • Members

  • 100 posts
  • Country: Country Flag

Posted 01 October 2013 - 09:44 AM

Thanks, Jake.  I have tried to install the plugin several times, but keep getting this error:

 

Unpacking the packageā€¦

Installing the pluginā€¦

The package could not be installed. No valid plugins were found.

Plugin install failed.

 

When I try to install it through the pageliens store, I get this error

 

Fatal error! The package could not be installed. PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature

 

 

Is there another place I can get this plugin? I suppose I can add a custom function if I change my theme, but I want to debug the styling using my theme and there must be an easier way to do this than switching between themes for ever change, right?



#8 Danny

Danny

    Is Awesome!

  • Moderators
  • 17580 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 01 October 2013 - 12:10 PM

Try this link - http://www.pagelines...s-customize.zip



#9 sethoof

sethoof

    Super Member

  • Members

  • 100 posts
  • Country: Country Flag

Posted 01 October 2013 - 12:22 PM

Cheers, Danny.  That worked.  I have activated the plugin, but can't find where to paste the code you suggested.  Not sure where to go to get to the plugin.



#10 Danny

Danny

    Is Awesome!

  • Moderators
  • 17580 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 01 October 2013 - 12:28 PM

You paste the code into the plugins functions.php file.

 

See here for more information - http://docs.pageline...ustomize-plugin



#11 sethoof

sethoof

    Super Member

  • Members

  • 100 posts
  • Country: Country Flag

Posted 02 October 2013 - 09:51 AM

Hi Danny,

I pasted your code into the customize plugin and nothing happened.  I realized the hook was probably not in the actual navbar, so I deleted your code and pasted the following code you provided in another answer that I planned to edit to include your code.

 

add_action(&#39;get_search_form&#39;, &#39;navbar_contact&#39;);
function navbar_contact() { ?>

<div class="navbar-info">
<p>155-9184745</p>
</div>
<?php
}

 

But before I edited the file, I updated to see if the hook was in the right place. But When I updated the file, it wiped out my site. I can't see anything on the dashboard (other than a white screen), nor can I see anything when I go to www.opfistula.org.  Its just a white screen.  Please help!!



#12 Danny

Danny

    Is Awesome!

  • Moderators
  • 17580 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 02 October 2013 - 10:00 AM

Where did you paste the code ?

 

Also, the code you added to your post above is not formatted correctly, if it has been added in this format, that is the likely cause of your white screen of death. Please take a screenshot of your where you added the code and then upload it to a imgur or another image hosting service then share the link.

 

Also, to resolve your issue, remove the code you have added, the you will be able to access your site again.



#13 sethoof

sethoof

    Super Member

  • Members

  • 100 posts
  • Country: Country Flag

Posted 02 October 2013 - 10:16 AM

Thanks, Danny.  White screen of death - no bueno.  I had posted it into pagelines-customize/functions.php but I have gone to the FTP and take ont the text so the site is back up.  (wiping sweat off brow).

 

Ok, I have added this adaptation of your code:

 

add_action( 'get_search_form', 'donate_button' );
 
function donate_button()  { ?>
 
<a class="btn btn-primary btn-small" href="#">Donate</a>
    
    <?php
    
}

 

This makes the button almost where I want it. I will want to change the format slightly and would prefer to put it in place of the search, but let's save that for now..  The problem with this button is that when I put it in, the logo on the left of the fixed navbar is no longer clickable.  We are using this to logo to get people back to the home page, so it being clickable is critical.  Is there anything we can do? 


  • batman likes this

#14 Danny

Danny

    Is Awesome!

  • Moderators
  • 17580 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 02 October 2013 - 10:43 AM

You will need to use additional CSS which I mentioned above when I provided the code, as it will most likely not be in the location you want. Unfortunately, we do not provide custom CSS support. I recommend you use Google Chromes Web dev tools, to inspect your button and play with its CSS.

 

You would probably want to give your button a custom class and use that to style it.



#15 sethoof

sethoof

    Super Member

  • Members

  • 100 posts
  • Country: Country Flag

Posted 02 October 2013 - 10:47 AM

No problem, I will figure out how to style this (or get some professional help as I like this stuff, but it is eating up all my time).   Any pros you could recommend?

 

But what about the logo not being clickable with the button installed?  Any fix for that?



#16 Danny

Danny

    Is Awesome!

  • Moderators
  • 17580 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 02 October 2013 - 10:51 AM

To resolve your logo not being clickable, try adding the following to your custom CSS:

 
#page .navbar .plbrand {
position: relative;
z-index: 99999;
}

As for a link to some Pros, who can assist you see our resources page - http://docs.pagelines.com/resources



#17 sethoof

sethoof

    Super Member

  • Members

  • 100 posts
  • Country: Country Flag

Posted 02 October 2013 - 11:06 AM

Added it, but the logo is still not clickable.  If I hover under the name, I can click, but the logo itself is still not clickable.



#18 Danny

Danny

    Is Awesome!

  • Moderators
  • 17580 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 02 October 2013 - 11:17 AM   Best Answer

Sorry the code I gave you is wrong.

Replace #page 

 

With #site


  • batman likes this

#19 sethoof

sethoof

    Super Member

  • Members

  • 100 posts
  • Country: Country Flag

Posted 02 October 2013 - 11:40 AM

That worked.  Thanks, Danny!! REally appreicate all your help!



#20 Danny

Danny

    Is Awesome!

  • Moderators
  • 17580 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 02 October 2013 - 11:42 AM

No problem.







Also tagged with one or more of these keywords: fixed navbar, customize