Jump to content

Archived

This topic is now archived and is closed to further replies.

sethoof

Donate Button in Fixed Navbar

Recommended Posts

sethoof    3
sethoof

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!

Share this post


Link to post
Share on other sites
James B    436
James B

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.pagelines.com/topic/22799-donate-button-next-to-social-media-icons-in-header/. You'll need either the base theme or customize plugin active on the site to paste the code into the functions.php.


Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites
sethoof    3
sethoof

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.

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

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.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
sethoof    3
sethoof

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?

Share this post


Link to post
Share on other sites
Jake    74
Jake

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


Have you searched the forums yet or checked out the DMS user docs?

PageLines geek, blogging at MyUntangledLife.com

Share this post


Link to post
Share on other sites
sethoof    3
sethoof

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?

Share this post


Link to post
Share on other sites
sethoof    3
sethoof

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.

Share this post


Link to post
Share on other sites
sethoof    3
sethoof

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!!

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

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.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
sethoof    3
sethoof

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? 

  • Like 1

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

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.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
sethoof    3
sethoof

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?

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

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


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
sethoof    3
sethoof

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.

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

Sorry the code I gave you is wrong.

Replace #page 

 

With #site

  • Like 1

Please search our forums, before posting!

Share this post


Link to post
Share on other sites
sethoof    3
sethoof

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

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

No problem.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites

  • Similar Content

    • reklov79
      By reklov79+
      Hi,
      Meganav seems to have a bug if you upload a Logo with a higher resolution (which actually is useful as it looks then sharper on mobile phones). But on mobile the Logo is then larger than on a desktop. Problem is the following code in the meganav style.css. Simply the "height: auto !important" needs to be removed.
      @media (max-width: 480px) { style.css?ver=5.0.14:133 body .meganav-logo img{ height: auto !important; } } But how to achieve that? What is the standard method for customizing that? Overriding via CSS / LESS doesn't work - in this case especially because of the !important derictive used in the original CSS I believe.
      Changing the original CSS is something I don't want to do as it leads into issues when upgrading.
      Btw: I seem not to be the only one with that issue - anyhow, the solution here (not displaying the Logo on mobile) is not acceptable for me.
      Thanks,
      Volker
       
    • sethoof
      By sethoof
      Trying to do some really simple font customization on the fixed navbar of my new site (www.sethcochran.com), but am just not figuring out how to get this done.  I have tried firebug, and read all the forum posts I can find and have tried three different custom css, but nothing seems to work 
       
      I want to make the font in the fixed navbar bigger, bold, and white.  
       
      .my-white-top {   .section-navi .nav-searchform, .section-navi ul {     font-size: 22px;     color: white;   } }   .bigger {   .navbar .navline > li > a {font-size: 22px; color:#ffffff !important;} }   test23 {   #navbaru89781 .navline > li > a { font-size: 30px;   } }    
      None of these has worked.  Can anyone help?
    • marcuscarson
      By marcuscarson
      I'm hoping to create multiple blog pages where each one only shows posts from a specific category.
       
      For example:
      Page 1: site.com/category/food Page 2: site.com/category/animals Page 3: site.com/category/mineral Currently, when I try to place a masthead section with a unique title at the top of one of these pages, the same masthead section appears on all of them. I have "unlinked" the page from any sort of template, and I have tried to create a unique templates for each. In all instances, the changes I make on one appears on all the other (except for the posts that are being displayed).
       
      Is it possible to do what I'm trying to accomplish? Any help is appreciated.
    • bwdsl247
      By bwdsl247
      Unless I am doing something wrong, I can confirm - and can replicate on demand - that DMS has a bug that causes the following things to occur whenever I click 'Customize' or go to Themes and switch to another Theme and then go back to DMS. 
       
      (Danny, you'll be happy to know that before reporting this, I deactivated all my plug-ins :-)  
      See DMS debug info below confirming this. 
       
      Here's what happens when I click 'Customize' or switch Themes:
       
      1. Custom CSS/LESS is wiped out.
      2. Main site logo is replaced with DMS2 logo; other DMS sample content appears on Home page, Headers and Footer.
      3. My existing post and page text and images are still there, but all headers and footers have been replaced, and all formatting lost.
      4. Debug mode was ON before clicking 'Customize' or switching Themes; afterwards, it shows set to off.
       
      There are currently no other users accessing the system. 
       
      I can replicate it on demand and recorded a video showing what happens. I am uploading it and will post it shortly for you to see.
       
      Is there anything I'm doing incorrectly, or is this a bug?
       
      Thank you!
       
      Scott
       
      =====
       
      DMS Debug Info WordPress Version
      4.0
      WordPress Debug
      Disabled
      Multisite Enabled
      No
      Current Role
      Administrator
      Framework Path
      /nas/wp/www/cluster-1349/bwise/wp-content/themes/dms/dms
      Framework URI
      http://bwise.wpengine.com/wp-content/themes/dms/dms
      Framework Version
      2.1.5
      PHP Version
      5.3
      WP_DEBUG
      No
      WP memory limit
      40 MB
      WP MAX memory limit
      256 MB
      PHP memory limit
      256 MB
      Mysql version
      5.5.27
      WP Max Upload Size
      50 MB
      PHP POST Max Size
      100 MB
      PHP Max Execution Time
      3600s
      PHP type
      Apache2handler
      WebServer software
      Apache
      PHP User
      Posix functions are disabled on this host. Not necessarily a problem, but if the user needs FTP/SFTP to install plugins/themes then creating CSS files might be an issue.
      OS
      Linux
       
      « Back
       
       
       
       
       
       
       
    • dbereit
      By dbereit
      Help! I spent several hours setting up my DMS 2 site, including some custom CSS. The only plugins running are the PageLines ones.
       
      I was frustrated when the Site Settings options would not allow me to save a custom text color, despite clicking the Publish button numerous times, and refreshing many times.
       
      I went into the WordPress dashboard, and clicked the Appearance > Customize option, thinking it might give me some additional editing options. Instead it opened the DMS tour, and wiped out ALL of the customizations I had previously set up.
       
      #1 question- can my work be restored?
       
      #2 question- will these bugs be fixed, so I don't experience these challenges in the future?
       
      I REALLY want to use DMS 2, but find times where it is buggy and problematic, which make me worry about long-term stability. If what happened to me today happened to a live, public site, I would be in big trouble.
×