Jump to content

Archived

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

vanessabt

Where to add a hook for Master Slider

Recommended Posts

vanessabt

Hi, 

 

I am starting to build a new site.  I would really like to use the MasterSlider plugin for my homepage slider.  I loaded it in and when I use it if I paste the generated shortcode into the page as instructed it ends up showing at the bottom of a content loop section instead of  at the top of the page.

 

I realize that a hook probably needs to be added to tell pagelines to run masterslider,  but for the life of me I have no clue what needs to be put in or where it would go.

 

I am building a demo site first before the site is moved so that I can troubleshoot issues like this.  I downloaded the base child theme since I figured we would need add the customization there to be safe from updates and for some reason the hooker section does not show up even though the plugin is installed so I cant use that either.

 

I am also confused. do I use an action hook from pagelines or one from the masterslider site, http://masterslider.com/doc/wp/developer/#action-hooks.

 

I tried to put both of these into the functions.php document

 

<?php get_masterslider(1); ?> 

<?php echo get_masterslider(1); ?>

 

but all that seem to do was break the site.

 

Does it need to be something like:

 

add_action('pagelines_page', 'masterslider_homepage');

   function masterslider_homepage(1) {

   <?php masterslider(1); ?>

}

 

I am sure that is probably nothing but a hot looking mess, but I am at a complete loss of ideas with this.  And where does code like this go into the functions php document? I thought it would go at the very top but I sure I am wrong.

 

Please let me know if you can provide any guidance.

 

Thank you

 

Share this post


Link to post
Share on other sites
Danny

Hi,

 

Your code as it looks isn't correct,  you will want to use something like this:

 

add_action('pagelines_page', 'masterslider_homepage');
   function masterslider_homepage() {
     masterslider(1);
   }
 
However, please be aware that hooks are considered advanced customisation and therefore, we are unable to provide further assistance. If you Google WordPress hooks guide, there are literally hundreds of articles that can assist you.
 
Also, if you have installed Hooker, there should be a new option in the WordPress Admin Dashboard under PageLines, called Hook editor.

Please search our forums, before posting!

Share this post


Link to post
Share on other sites
vanessabt

Thanks Danny,

 

I see the hook editor now.

 

I would like to start building child themes for clients but I am not that advanced yet.  So it does make me a bit nervous. I have just finally gotten a pretty good handle on using the CSS editor to really build and customize my pages. I hope you don't mind but I have a couple of questions.

  • If I use the masterslider plugin what is your recommendation?  
  • Can I use the hook editor? If I use the hook editor do I need to use a child theme or can I just use the DMS theme with out a child theme?
  • Will that be safe from theme upgrades?  
  • I don't want the slider to disappear when an upgrade is available.  What is your recommendation on how you think it would be best to implement using masterslider plugin with pagelines?

If I use the code above in the functions.php file in a child theme:  Does it go at the top of the page? Also, is 'pagelines_page' the correct hook to use or should it be be 'pagelines_head' since I want the masterslider plugin to function in the slider on the home page?  I haven't decided if it will be used anywhere else yet.  I may feature it on a store page for a woo commerece store.  What are your thoughts about this?

 

I would prefer to implement the masterslider in a way that still keeps me inside the realm of access to support from your team.  

 

Also, is there any step by step training on how to build child-themes?  I noticed that there is some documentation in pagelines docs but nothing about it in pagelines academy and I would love to have a step by step guide exercise to build an example child theme so that it helps me to understand better how to do it on my own.  

 

I appreciate your feedback and look forward to hearing from you.

Share this post


Link to post
Share on other sites
Danny

There is nothing to worry about when it comes to child themes, it can be bit overwhelming at first, if you haven't used them before, but they're simply to use and setup. I have created a child theme that contains nothing, but the bare bone files hence the name skeleton. You can download it here and it also contains a read me file with instructions on how to rename skeleton and so forth.

 

https://github.com/Dannyholt/skeleton

 

1. Not sure what you mean, by "If I use the masterslider plugin what is your recommendation?"

 

2. The Hooker plugin doesn't require a child theme, it is it's own standalone plugin.

 

3. Hooker isn't effected by updates to DMS Framework or Core themes.

 

4. You can implement the slider in a number of ways:

 

A: Create your own section = Best overall, but the most advanced method.

B: Use the NextBox section and add the PHP code/shortcode (if plugin supports it) from the sliders documentation. = Simplest method and easy to place the slider wherever you like.

C: Use the Hooker plugin = Simple and easy to manage.

D: Use a child theme = Simple and easy to manage.

 

In my option the best method would be to create a section. However, this would require some PHP knowledge. If you're not comfortable doing this, then you will probably want to use the NextBox section.

 

What I recommend you do is use the DMS Pro Tools plugins, when activated, go to the Pro Tools plugin settings and enable ActionMap. This will add a new option to your WordPress Admin bar when viewing your site on the front-end. Click the Action Map link and will print out all available action hooks on your template. You can use this to determine the location of the hook you wish to use.

 

Unfortunately, we do not provide support for third party plugins. Therefore, if you have issues implementing, you can ask here, but it will most likely be better contacting the developer of the plugin.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
TourKick (Clifford P)
Doesn't Master Slider provide a shortcode? If yes, just drop in a TextBox section and enter the shortcode there.

Share this post


Link to post
Share on other sites
vanessabt

Hi Clifford,

it does provide a shortcode but when I put it into a text box inside a canvas section it was not allowing it to run on a full width option.  I am assuming because the text box lives in a container in the section.

Share this post


Link to post
Share on other sites
vanessabt

Hi Danny,

Thank you for your feedback.  I am going to test some of these options and let you know.  I may have a one more question for the time being.  Are there instructions that you may have a link to for creating a section?  I assume that you are referencing something more difficult than just dragging in the sections that you want to a canvas area and then clicking the "save as a section" button and giving it a name right?

Share this post


Link to post
Share on other sites
TourKick (Clifford P)

It's as easy as you're wanting it to be. :-)

  1. Install the plugin/section I linked to
  2. Activate the plugin
  3. Visit the page
  4. Drag the FULL-WIDTH NextBox where you want it
  5. Add the shortcode inside the NextBox section's options
  6. Delete the TextBox and Canvas Area sections as desired

Share this post


Link to post
Share on other sites
vanessabt

great!  Thank you for your solutions.  I was able to integrate this into the demo site that I am working on.  Danny, I am going to start a new thread with a questions regarding your child theme unless you have an email that I can send you correspondence directly.  Posting it now.

Share this post


Link to post
Share on other sites

  • Similar Content

    • jaithai
      By jaithai+
      Unable to attach an image that's already been uploaded.
      When attempting to upload one from scratch, it gives me the error seen in the screenshot. As you can see by the Chrome Inspector, I receive a 400 error.
       

    • stijnxo
      By stijnxo+
      Ik like to use the following Plug-in in my DMS Theme, but can' get it to work. My DMS Editor is not loading anymore if I paste this short code in a page, textbox or mediabox: [wpdatatable id=1]
      Plug-in: WPDataTables Plug-in 
      Shortcode:  [wpdatatable id=1]
      Website: http://gentleclinics.nl/prijslijst-heren/

      Anyone experience with this plug-in and DMS.
    • foxwatson
      By foxwatson+
      I recently downloaded the latest DMS2 update. Since the download, I lost front end ability to update. Any suggestions would be appreciated.  
    • Justin Taylor
      By Justin Taylor
      I originally purchased, I believe, a 3 site licence for DMS2. The new account interface does not reveal any of this information.
      How do I know how many licences I am entitled to? How do I reset one for a new website? All it says now is that I don't have any Pro licences?
    • HenryMote
      By HenryMote
      Hi guys,
       
      I have DMS and the maps isnt working. Here's the link to the site where you can see the error .http://plumb-now.co.uk/
       
      Thanks for your help!
       
×