Jump to content

Archived

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

rsmm

How to use pl-area-inner-classes and pl-area-inner-style filters

Recommended Posts

rsmm

I've figured out how to use these filters. But I can't figure out how to isolate a single area instead of applying the filter to all the areas.


add_filter('pl-area-inner-style', function($style){
  $style .= "background: #f90;";
  return $style;
});
 
add_filter('pl-area-inner-classes', function($classes){
  $classes .= " amazing-class";
  return $classes;
});

 

I feel like I must be missing something obvious. And I don't know nearly as much about filters as I probably could. Anyone have any ideas?

 

Share this post


Link to post
Share on other sites
Simon

You get extra points for using anonymous functions, remember you cant use remove_filter with them ;)

 

anyway is this needed on one page? if so do a global $page and check the ID

Share this post


Link to post
Share on other sites
rsmm

Hey there Simon_P, thanks for getting back to me. I'm mostly curious if there's a way to target a specific canvas area. I'm guessing it's not really possible. This probably isn't the way to go about it. I don't have a real purpose in mind at the moment. Just exploring capabilities and ideas.

Share this post


Link to post
Share on other sites
Simon

Yea, maybe the section ID should be included in the filter, I might have to add that. 

Share this post


Link to post
Share on other sites
rsmm

That would be cool. Is there any way to add options to PLSectionArea / Canvases? Say I wanted to add another select field that allows me to choose different parallax effects, or a checbox that triggers the markup for an arrow to appear before or after the section... filters & hooks for that would be really nice. I'd love to be able to alter the output of Canvases, and add extra options to it.

Share this post


Link to post
Share on other sites
Simon

you can filter the output of ANY section. Its pretty complicated tho ;)

 

If you are PHP savvy take a look at the section caching code in the pro tools plugin.

Share this post


Link to post
Share on other sites
rsmm

I'll take a look at that. Thanks.

Share this post


Link to post
Share on other sites

  • Similar Content

    • Lisa Haran
      By Lisa Haran+
      Hi 
      I have a map here http://www.iloveoffset.com/maps/
      I want to add several pointer locations to the map, but when I do they do not appear.
      On this map there are 2 pointer locations and as you can there is only one visible.
      Earlier today I added 7 and could only see 4 so there is something odd going on.
      My theme is up to date
    • clj182
      By clj182+
      Hello,
      I've been having trouble unlocking the template section for past couple of weeks. When I try clicking nothing happens. 
      I've deleted my custom css and removed plugins. Im down to having only the following plugins:
      Akismet
      Contact Form 7
      DMS Professional Tools
      Pagelines Updater
      WooCommerce
      It was working fine before i have no idea what's going on with it.
    • flourishdesignstudio
      By flourishdesignstudio+
      My DMS 2 site http://www.heart-stone.com/ will not save any new custom css... I can still edit templates and publish those but any custom css that I enter never saves.
      All WP files, themes, and plugins are up to date. 
      Any thought about what might be causing this?
    • flourishdesignstudio
      By flourishdesignstudio+
      Is there a way to edit the custom CSS via FTP? I know I can edit the custom code in the Chrome editor but is there a file path I can use to find and edit the CSS directly from our FTP?
      Thanks in advance for the help!
    • nizami
      By nizami+
      Using navbar section with correctly configured WP menu to display main navigation at https://elenaangel.com. 
      All fine in desktop viewport. Menu displays twice in hamburger mode. How to fix this please? 

×