Jump to content

Archived

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

Donnie Darko

How to add a button "Save less" to WP admin bar

Recommended Posts

Donnie Darko

Hello I need to add an admin bar button to save less

Share this post


Link to post
Share on other sites
Danny

Hi,

 

I am not sure what you;re referring to, but if you want to add a menu item to the Wordpress Adminbar you will need to ask this question on the Wordpress support forums, as it is related to Wordpress not PageLines.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
Donnie Darko

Hi,

 

I am not sure what you;re referring to, but if you want to add a menu item to the Wordpress Adminbar you will need to ask this question on the Wordpress support forums, as it is related to Wordpress not PageLines.

 

Ok

 

I have no problem with a function that adds an item to the menu in the "WP admin bar", but I need to know what do I add an item to the menu.
 
Here is an example
 

 

<?php

function mytheme_admin_bar_render() {

global $wp_admin_bar; // we can remove a menu item, like the Comments link, just by knowing the right $id

$wp_admin_bar->remove_menu('comments'); // or we can remove a submenu, like New Link.

$wp_admin_bar->remove_menu('new-link', 'new-content'); // we can add a submenu item too

$wp_admin_bar->add_menu( array( 'parent' => 'new-content', 'id' => 'new_media', 'title' => __('Media'), 'href' => admin_url( 'media-new.php') ) ); } // and we hook our function via

add_action( 'wp_before_admin_bar_render', 'mytheme_admin_bar_render' );

?>

 

As I discovered so "Save LESS" in Admin "PageLines> Dashboard> DMS Tools' link to the ajax.

Which link to insert into the menu?

Share this post


Link to post
Share on other sites
Rob

Donnie,

 

That needs to be in a specific hook, but I'm not sure how or which.  You're going to have to modify a WordPress file, since you're working on the WP Admin bar. That's basically out of our control. Check Wordpress.org to see if you can find a solution there.  One may exist in their codex.

 

http://wordpress.org/support/topic/customize-the-admin-bar


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites

  • Similar Content

    • Michael Kummer
      By Michael Kummer+
      Hi guys!
      I am using the LESS/CSS Pagelines extension and tried to add the following code to make use of FontAwesome:
      a.c2a:before {
          content: "\f07a\00a0";
          font-family: "Font Awesome 5 Pro";
          Font-weight: 900;
          font-style: normal;
          font-weight: normal;
          text-decoration: inherit;
          padding-left: 4px;
      }
       
      The issue is that as soon as I have the CSS via the Custom Styling text box, Pagelines (or the extension) strips out the backslashes (\). As a result, I had to abandon the CSS/LESS extension and instead add all my CSS code to a separate .css file.
      Is there a fix or workaround for this?
      Thanks
      Michael
    • GreyFoxWebDesign
      By GreyFoxWebDesign+
      Hi, could you let me know where the custom less/css is saved to - i.e. how I could access it directly via the server.
      I hid the Admin Bar by mistake and now can't save any changes to the Custom CSS as the Save Button is not available - so I need to find another way to access and edit the custom CSS.
      Thanks in advance
    • Audun MB
      By Audun MB+
      How do I get the LESS in a child theme to compile?
    • dymond
      By dymond+
      I've been trying to upload a video to use as a video background, but the size was 12m, and the alotted max file size is 8m. I downloaded a couple of pugins that increase the size by creating php.ini files and all of that jazz, but to no avail. It would say (Max file size = 250mb) but after I uploaded I would get an "HTTP ERROR",
      Soooo I logged into my cpanel and saw that the php I was using was 4 version out of date. I upgraded my php to PHP 5.6 and now I get
      Fatal error: Out of memory (allocated 39583744) (tried to allocate 15 bytes) in /homepages/39/d200014696/htdocs/dymondentertainment.com/wp-content/themes/dms/dms/includes/less.plugin.php on line 848
      When I activiate another theme that is not pagleines, the site works fine.... but will no longer work with Pagelines DMS Version 2.2
       
      My site has no gone dark. What can I do?
    • station16
      By station16
      I installed DMS for a new site and got an error message on install and when I install any plugin.
      Warning: Invalid argument supplied for foreach() in /nfs/c09/h04/mnt/208781/domains/prevailcoffee.co/html/wp-content/themes/dms/dms/includes/less.legacy.php on line 818
      I installed the latest DMS 2.1.9.6
       
      Please advise. I'm now having issues getting any plugins to work. Not sure what to do next.
      thanks,
      -b
×