Jump to content
Sign in to follow this  
espartaco

Hooker plugin - How to use specific features.

Recommended Posts

espartaco    0
espartaco

Hi all,

 

I've just bought the hooker plugin because I am interesting into adding custom js to some of my post/pages.

 

I have seen here [http://www.pagelines.com/store/plugins/hooker/#] the next features:

 

  1. Assign hooks to specific pages/posts easily.
  2. Toggle hooks on/off.

The question is... how? Because when I am creating a new Hook (using this plugin), I can select many locations but I can not see my actual pages or post...

 

Any advice?

 

Thanks.

post-45911-0-74994900-1363783908_thumb.p

Share this post


Link to post
Share on other sites
greenfly    230
greenfly

Hi Espartaco 

 

Install the free Action-Map plugin to see where WordPress and PageLines actions are included in the templates live on the page. http://www.pagelines.com/store/plugins/pagelines-action-map/

 

Once activated, when you are logged in and view your site you will see an ‘action map on or off’ button on the admin bar. http://d.pr/i/weQ


Toggle on or off to see the available hooks.


The answer to many issues can be found by searching in the forum before posting as someone else  may very well have had the same problem before you have.  Also, reading the documentation can help you gain a good understanding of how everything works. 

 

Please do not send me private messages. Occam's razor - The principle states "Keep things simple!"

Share this post


Link to post
Share on other sites
espartaco    0
espartaco

Hi Martin,

 

First of all thank you for your quick response.

Playing with the plugin(creating one hook and delete it) I think I broke something (quite common situation  :D ). Right now if the plugin is activated I am getting this error when I try to load my web:

 

Fatal error: Call to a member function add_menu() on a non-object in /..../..../wp-content/plugins/hooker/hooker.php on line 44

 

How can I solve this problem?? After solve it I'll try your notes.

 

Other question, I have been trying other of your plugins (Simply Custom) which is more intuitive for me, but when I try to inject a simple alert('Hello world'); it doesn't work, nothing happens. Why?? Any idea?

 

Thanks in advance,

Share this post


Link to post
Share on other sites
anlinares    1
anlinares

I just installed the Hooker plugin and am getting the same Fatal Error

Share this post


Link to post
Share on other sites
anlinares    1
anlinares

Just found this on another thread:

 

edit hooker.php line 42 to read: if ( current_user_can('edit_theme_options') && is_object( $wp_admin_bar ) ) {

Share this post


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

Did the above work for you?

 

I think this error was related to the admin bar being disabled, Simon is pushing a fix for this.

 

Please see - http://www.pagelines.com/forum/topic/26032-using-hooker-on-wp-engine-hosted-site-turns-site-blank/


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
espartaco    0
espartaco

Thanks James!

 

Simon patch solve the problem. With the 1.3 version is working. 

 

Anyway, I'll still interested in the "simply plugin" custom plugin. 

 

I have attached one screenshot which represent the edit menu of one of my web's page.

 

Both custom code (HTML and JS) are not working... he question is... why??

 

What am I missing?

 

Thanks in advance.

post-45911-0-73657800-1363854803_thumb.p

Share this post


Link to post
Share on other sites
espartaco    0
espartaco

Thanks Danny, in that case I am going to make focus on the Hooks solution (Simply plugin looks like abandoned).

 

The only thing that I need to find out is how can I create hooks for specific pages? Any link to some documentation or example?

 

I know with the "Action-map" plugin allows me all the hooks available, and with the Hookers plugin I can create hookers, but I don't know how  I can associate to one concrete page.

 

If you have any advise, are more than welcome :) .

 

Thanks!.

Share this post


Link to post
Share on other sites
espartaco    0
espartaco

Thanks again,

 

I'll take a look into everything. This concept is new for me, I've been trying to avoid do something with php, but I think is worth learn the basic.

 

I am full experience J2EE (GWT) developer and in that way I can inject my modules with a RestFul API into the PageLines' CMS in safe way.

 

Regards.

Share this post


Link to post
Share on other sites
espartaco    0
espartaco
Hi again,

 

quick question, how can I inject JS? I have attached one picture.

 

The plugin seems to work but instead of executing the JS I see the "alert('Hello world');" in the web!

 

Also if I put this code inside <script> tags it doesn't work as well (also it stop other pluins...)

 

Thanks.

post-45911-0-58053100-1363868753_thumb.p

Share this post


Link to post
Share on other sites
espartaco    0
espartaco
<style>
	#bbpress-forums{
  		color:yellow !important;
		display : none;
	}
</style>

<script>
	alert("test");
	$(document).ready(function() {
            alert("test2");
 	});

	//jQuery(document).ready(function($) {
	//	alert("test 3);
	//});
</script> 

 

Ok I think I have a couple of examples working. The only problem is I don't know how can I use jQuery after the document is loaded (the first alert test works).

 

This code works if I introduced it in the header oft he page (via PageLines > Site Options > Custom Code ) but inside a hook no chance.

 

Any advise?

 

Thanks.

Share this post


Link to post
Share on other sites
espartaco    0
espartaco

Never mind, solve it!

 

Thanks anyway.

Share this post


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

Hi,

 

Would you mind sharing so other users who may have a similar issue, can use this as a resource.


Please search our forums, before posting!

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

Sign in to follow this  

  • Similar Content

    • webmktco
      By webmktco+
      I'm getting the following errors when trying to add hooks:

      Here's the debug info: http://www.stackdental.com/?pldebug=1
      Core, themes, and plugins are up to date.
       
       
       
    • art23130
      By art23130+
      We had a very nice shortcodes library and hooker in the previous version of the platform. But in the version 5 they are missing. 
      So are you going to improve it again in future or no they are not supported anymore? 
      and one more question, what do you suggest for sharing bar which we had in DMS2 ?
      Thanks for your effort 
    • dreamsight
      By dreamsight+
      We add phone number to the top right of sites using hooker (example http://hub.theasap.org.uk/) but it's not responsive. Is there a better way to add here, which would be responsive?
    • kellid
      By kellid
      Hello, 
      I'm in a dramatic situation.  I have a live site that is totally screwed up and I'm in desperate need to fix it asap.  The site was originally build with Pagelines but have made several upgrades through the years.  With the latest WP upgrade, somehow the action loop I was using on my homepage came through dramatically wrong and not sure how to fix the problem.  I have the Hooker plugin and in need of finding the action map to figure out where to implement the loop and fix the problem.  I found the action map plugin stored on an old hardrive but when activated, I got an error so I quickly deleted it.  I can't find a download or instructions on this anywhere, only broken links and no documentation.   
      Can you please direct me to the action map to use the hooker that I already have or show me the documentation to use this product?  
      Thank you
    • ipitts
      By ipitts+
      To whom it may concern:
      I am developing a website for a client using the PageLines DMS2 theme and am having an issue getting a custom jQuery function to work using your Hooker plugin. I have used Hooker to add HTML and PHP to the wp_head hook successfully, so I do not understand where the issue exists – I am using the pageslines_after_footer hook to place my jQuery at the bottom of the document (alongside the many other scripts that come with the theme and various other plugins). I checked the document HEAD section and know that jQuery is enabled, and after enabling my custom hook saw that my script was loaded into the footer (as hoped for), but it is not working.
      I am trying to make a simple, custom back-to-top button that appears after a user has scrolled the page a certain distance, as calculated in jQuery. After an hour, I decided to troubleshoot my script on a test WordPress site on my localhost (using jQuery version 1.11.3) and it works exactly as intended. I would like to avoid writing any code within the DMS2 theme files if possible.
      I have also tried the wp_head, wp_footer and pagelines_before_footer hooks to no avail. Am I using the wrong hook(s)? What else can I try?
      My code:
      HTML
      <a href="#"><div id="bttb-cont" style="">Hello</div></a>
       
      jQuery (within the Hooker plugin)
      <script type="text/javascript">
                      $(document).scroll(function() {
                                      var windowHeight = $(window).height() / 7;
                                      var scroll = $(window).scrollTop();
                                      
                                      if (scroll > windowHeight) {
                                                      $('#bttb-cont').fadeIn();
                                      } else {
                                                      $('#bttb-cont').fadeOut();
                                      };
                      });
      </script>
       
      As you can see, it is a very simple script.. Any help on this matter will be greatly appreciated.
       
×