Jump to content


Photo
- - - - -

Installing javascript plugin


Best Answer James B , 11 March 2014 - 12:57 AM

Any editing to the functions.php which isn't correctly coded will unfortunately bring the site down, you'll need to go in via ftp or cpanel and edit the code out of the file to get it back up and running. Sometimes the plugin author will provide you with the correct code for the wp hook if you state to them what you need etc.

Go to the full post


  • Please log in to reply
9 replies to this topic

#1 insatiableiam

insatiableiam

    Advanced Member

  • Members
  • PipPipPip
  • 34 posts
  • Country: Country Flag

Posted 08 March 2014 - 09:08 PM

I am trying to figure out how to install a javascript/jquery plugin into Pagelines

 

I recently purchased http://codecanyon.ne..._author=bmihai 

 

Problem is it's not wordpress compatible, just trying to see if anyone would know how to add the files manually into the backend in order for me to make it work, because it's one thing to make it work with wordpress, but it's another to make it work on DMS

 

 

Just figured to take a shot in a dark if anyone has done something like this in the past.

 

 

Thanks



#2 batman

batman

    Bat Learning

  • Members

  • 2203 posts
  • LocationBuenos Aires, Argentina
  • Framework Version:DMS
  • Country: Country Flag

Posted 08 March 2014 - 11:11 PM

Hi @insatiableiam

 

We do not provide support for third party plugins, you will need to contact their support.

 

Regards

 



#3 insatiableiam

insatiableiam

    Advanced Member

  • Members
  • PipPipPip
  • 34 posts
  • Country: Country Flag

Posted 09 March 2014 - 12:30 AM

I am not asking for support on third party plugins, I am asking how to add custom jquery/script within the php of DMS's theme. Considering the framework is much different than just customizing wordpress alone. Say if I wanted to opt for more customization which is what I am trying to do, I am trying to figure out where I would make these changes without having much conflict.

 

I pretty much want to find out where would I go to make changes to the head section and body within DMS


Edited by insatiableiam, 09 March 2014 - 12:40 AM.


#4 Danny

Danny

    Is Awesome!

  • Moderators
  • 17666 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 09 March 2014 - 12:01 PM

Hi,

 

First you will want to use a child theme, then if you require adding custom scripts you can either use the Custom scripts area in the DMS Toolbar or enqueue them via hooks in your functions.php file. You could depending on how this script is coded, create a custom section and place the code in there. You can find instructions on how to use hooks and create sections via our documentation.

 

http://docs.pageline.../advanced/hooks

http://docs.pageline...per/section-api

 

I have no experience with this script, so the best course of action would be to contact the author of the script for assistance. As we do not provide support for third party extensions or scripts.


  • batman likes this

#5 insatiableiam

insatiableiam

    Advanced Member

  • Members
  • PipPipPip
  • 34 posts
  • Country: Country Flag

Posted 10 March 2014 - 01:24 AM

Thanks Danny, What would be considered a child's theme? I thought DMS was one, maybe I am confused with how the whole system is compiled together. 

 

So any changes I want assuming I read more into hooks, it would be within the functions.php then? would you have an idea how I would put it on a specific part of the page instead of it being an master function for all pages?  I am definitely trying to extend my knowledge with javascript and jquery but seem placement of where to put the script is totally different vs if I was creating .html pages from scratch. Guess I am still trying to get used to Pagelines but also trying to maximize what I can do with it and  give back to the community with pointers in the future.

 

Yeah, I already have, just figured I would play around with what options I have available while waiting to see if I can figure it out, nothing more exciting than solving an issue heh.



#6 Danny

Danny

    Is Awesome!

  • Moderators
  • 17666 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 10 March 2014 - 11:52 AM

DMS isn't a child theme, a child theme can not work independently, it has to have a parent theme. DMS is a Design Management System that supports child themes.

 

The purpose of child themes is that they inherit the functionality of the parent theme in our case DMS. What this means is that, you do not have to edit the core files of DMS, this is something we do not recommend and will void all support if you proceed.

 

This child theme system isn't something only DMS utilizes, this system is used vigorously throughout Wordpress, nearly all themes support child themes. For more information on child themes see the Wordpress Codex - https://codex.wordpr...rg/Child_Themes

 

You can create your own child theme, use a third party one such as Nicks Base Theme or you can use my skeleton child theme from my GitHub. It contains nothing except the bare bone files. However, you can copy the sections folder and LESS folder to give you much more control over how your child theme works.

 

https://github.com/Dannyholt/Skeleton

 

In regards to adding custom JavaScript, you can either enqueue it via your functions.php file - http://codex.wordpre..._enqueue_script

or use the DMS Custom > Custom Scripts via the DMS Toolbar.

 

If you come from a background of developing websites from static files i.e. having to include the header and footer for each page you create, using Wordpress and DMS will likely be a culture shock to you, as this is not needed. The inclusion of the header and footer are done automatically for you, that's why when you want to add new scripts you will want to enqueue via functions.php file in your child theme or using the DMS Custom Scripts option area.

 

In regards to adding jQuery, this is not needed as Wordpress already includes it.


  • batman likes this

#7 insatiableiam

insatiableiam

    Advanced Member

  • Members
  • PipPipPip
  • 34 posts
  • Country: Country Flag

Posted 10 March 2014 - 10:11 PM

Ah I see now, I think I'll stay away from child's theme, sounds more of a hassle but I can see why some would want to manage it. 

 

 

For some reason when I try to register and enqueue a script and stylesheet to the functions.php file, the site breaks, like nothing is accessible, perhaps my code is wrong? 

 

 

Yeah I do come from more of a traditional background when it comes to web developing,  I was introduced to this system by a mentor of mine and it just made web development so much more fluent and quick.



#8 James B

James B

    Advocate

  • Members

  • 5126 posts
  • LocationSurrey - UK
  • Country: Country Flag

Posted 11 March 2014 - 12:57 AM   Best Answer

Any editing to the functions.php which isn't correctly coded will unfortunately bring the site down, you'll need to go in via ftp or cpanel and edit the code out of the file to get it back up and running. Sometimes the plugin author will provide you with the correct code for the wp hook if you state to them what you need etc.


  • insatiableiam likes this

#9 insatiableiam

insatiableiam

    Advanced Member

  • Members
  • PipPipPip
  • 34 posts
  • Country: Country Flag

Posted 11 March 2014 - 01:03 AM

What's weird is, I used the exact same code that I did in the functions.php that broke the site in a custom plugin I created for wordpress and I managed to get the scripts to run from there. I also read it's much safer to enqueue and register scripts through plugins as wordpress/dms has updates and it may overwrite any customization if I am not mistaken? 



#10 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 11 March 2014 - 01:09 AM

Yes, you should never edit a themes file.

 

If you want to overide theme files, use a child theme, if you want to include other file use a plugin.

 

Seeing as you are on the right track, post the code you are trying to use here and we will do our best to help you, but as Batman already said we wont support your 3rd party plugin.

 

Please use a pastebin to post code


  • insatiableiam likes this