Jump to content

where to drop php code generated by a wp-plugin

Recommended Posts


Hi everybody

and thanks for your kind support.


Objective: since 2011 I've been trying to add a good javascript slider

to my site frontpage.


I've tested many free plugin and searched 

for solid pro solutions too. But I couldn't get thorugh that.


I have seen pagelines storage pro slide too, but that it's not ok for me.


Actually I've come back to the issue and trying Content slide plugin.


Problem: I just have no idea where to drop 

the generated php code.

Generally, in a simple template, the right place should be page.php... 


Have you an y idea about that?


Thanks a lot



Website URL: http://.www.velediluce.com

Framework Version: 2.4.2

WordPress Version: 3.5.1

Plugins in Use:

akismet, All in one Seo, Cardy redirect, Contact form 7, Feed burner smith, Google analytics, google xml sitemap, Most popula post, nofollow free, sharebar, subscribe to comment, Tiny MCE, wp ban, wp DB-manager, no category base, wp smush it, wp super cache,

Share this post

Link to post
Share on other sites



PageLines Framework isn't an old-fashioned theme with a page.php to edit.  Most sliders today, particularly pro versions, have a shortcode to apply, rather than PHP script.


Since you're not likely to use a slider on every page, you'd not want to add it to a template anyway.


If your slider only provides PHP script, then go to WordPress.org and get ShortCode Exec PHP, which will convert your PHP script into a shortcode you an past into a page in the edit field.


I'd also ask the developer to create a shortcode for his/her product.

Former PageLines Moderator, Food Expert and Raconteur

Share this post

Link to post
Share on other sites



converting php code into a short code is more friendly, thanks!


Nevertheless, I wouldn't drop the short code into a page or into a post, but into my blogpage.


So the points are:


1) In > Pagelines site option > custome code    only 4 options are avalaible: css, header code, footer code, asyncronous analytics code.


2) The classic old way - editing a php file via > Appearence > Editor - is not adviced at all by Pagelines, I'd say almost forbidden...


So, where and how am I to bound to add my shortcode?


Thank you very much!

Share this post

Link to post
Share on other sites

You can add a universal sidebar or content box section to your Blog Post template. Then add the shortcode or into a text widget.

Former PageLines Moderator, Food Expert and Raconteur

Share this post

Link to post
Share on other sites

At the moment, when I publish a box,

and try to view it, I have a 404 error...


do I need to open a new topic for that?

Share this post

Link to post
Share on other sites

No need to open a new topic.


To be clear, you're going to Dashboard > PageLines > Drag & Drop, and adding the Universal or Full-Width sidebar underneath the navigation section you're using in Active Sections under Header.


Then you're going to Dashboard > Appearance > Menus and adding your widget to that sidebar?

Former PageLines Moderator, Food Expert and Raconteur

Share this post

Link to post
Share on other sites

I am sorry, I'm afraid I didn't catch your replay,


in wich you mention sidebars and widgets...



Maybe i need to explicit better my objective:


I'd like to add a javascript post slider to my home page.


The post slider should be in the content section, just before the post loop


As I already pointed out, even by using a shortcode, I don't get through it becouse:


1) In > Pagelines site option > custome code    only 4 options are avalaible: css, header code, footer code, asyncronous analytics code.


2) The classic old way - editing a php file via > Appearence > Editor - is not adviced at all by Pagelines, I'd say almost forbidden...



You kindly suggested to drop the short code into a new box,


but at the moment any box gives 404 error.


Thanks for your patient attention


Share this post

Link to post
Share on other sites
James B

Hi there,


I think Rob was referring to putting the shortcode into either a contentbox (free container section from the pagelines store) or a blank text widget within a sidebar container in the drag and drop. Pagelines has options for full width sidebars which go inside the content area. The code to be used with the exec php should be placed directly into widget or contentbox, it shouldn't go into any of the code boxes in the custom code page, those are for either css or scripts not php or shortcodes etc.


If you're looking to place the code into a particular place in the page and have the code you could look into using a hook which will pace the php into a specific part of the template.


Pagelines has a whole collection of hooks built in. To find the one which might help you position the slider into the correct place check out the action map plugin - http://support.pagelines.me/docs/plugins/action-map/


Using this you'll be able to see where each hook starts and finishes on the page, and pick the one in the area you want to add your code. Full info on using the actionmap plugin is here - http://support.pagelines.me/docs/plugins/action-map/


Then you can put your hook and php into the functions.php of either the base theme or the customise plugin - http://support.pagelines.me/docs/customization/hooks/ Check with the plugin author, they might even be able to provide you the best code to use inside the hook, some plugins provide this in the plugin instructions.

  • Like 1

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



Thanks so much for your really exaustive reply.


I hope this is the right pathway to my craved post slider on the homepage.



I downloaded and installed Action Map plugin, as you suggest


and I think the hook I need should be: pagelines_before_postloop.



Now, the next step is to drop it in the "right line".


In the Editor section I can see "Theme Functions (functions.php)" (very few lines)


and "less.functions.php" (it looks longer, like a classic function.php);


and i'm not quite sure which is the good one.



Besides,I have seen how complex is the framework: so I wouldn't like to drop the hook 


in the wrong line...and break off the site!



Share this post

Link to post
Share on other sites

Use the functions.php in your child theme.

Share this post

Link to post
Share on other sites

I tried to add the short code to some php  file in .../wp-content/themes/pagelines/...


But the site broke, so I had to restore a copy of the original.



so guys, sorry but I think I really need some direction about that...

Share this post

Link to post
Share on other sites

Hello Walter. 


Install either the Pagelines Customization plugin from the store http://www.pagelines.com/store/plugins/pagelines-customize/ or the free base theme http://www.pagelines.com/store/themes/pagelines-template-theme/.


You can then use the required php files from your child theme or customization plugin rather than from the Framework. 


You can find more information regarding this is in the Customization methods  documentation here http://support.pagelines.me/docs/customization/customization-methods/

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

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

  • Similar Content

    • jeomiland
      By jeomiland+
      I just migrated an old DMS2 site to PL5 at cassClayton.com. If you look at the site on Safari browser, you will see the top nav bar (NavPro) is white, but gets revealed as you start to scroll the page. NavPro is used in the Header section, then a Text section in which I have Shortcode for the Smart Slider3 plugin. Would have preferred to use a PL-compatible slider but found it difficult to get Flick and Impress slider to simply fill full screen, just height of images (they were filling whole screen, hence large black area filling in the rest).
      So seems on Safari that the load order of the plugin may be causing the Nav bar to be overwritten? or something. 
      Hoping someone can help?
      thanks...  (works fine on Chrome, Firefox, even Tor, just not Safari)
    • Perry
      By Perry+
      Hello there,
      We are still using DMS 2 and were wondering if it was at all compatible with slider revolution. (https://codecanyon.net/item/slider-revolution-responsive-wordpress-plugin/2751380). Our issue is that the default revslider for DMS clips the top and sides of videos when made responsive. As the video is made smaller or larger the bottom of it tends to be cut off, or the sides are. We noticed slider revolution was 100% responsive, but have had numerous issues even getting it to display in DMS 2. We have tried using the shortcode, and various php scripts to no avail. Our last attempt was to try and load it with header scripts, but at this point we seem to be further away than ever. 
      This leads me to a few questions:
      1. Is Slider Revolution even compatible with DMS2?
      2. Is there a way we can get 100% responsive video in DMS 2 with zero clipping? (tonyrobbins.com is another good example of the effect we are trying to achieve.)
      3. If Slider Revolution is compatible, how do we go about adding it in?
      Thank you for any help.
    • vanessabt
      By vanessabt+
      Hi Developers, I wasn’t sure what the best way to get feedback was but didn’t really want to put this in the facebook group, I did put this in the slack developers group but trying to figure out the fastest way to get feedback.  I am starting a new site for a client and was looking through the showcase to see if there were any samples for slider modifications like I am trying to do for our build and couldn’t find them.  Basically I want to have a blue section at the bottom of each slide that has text in it.  The text will change with each slide along with the image.  Was wondering if anyone had any thoughts on how this modification could be made?  Here is a sample of the slider from the design.

    • paoloimperiale
      By paoloimperiale+
      I was wondering if there's a way to modify the slider container size? My client would like it skinner- not as tall. How would you suggest doing that?
      Thank you.
      (this is for the paoloimperiale.com slider on the homepage) 
    • crose
      By crose+
      I am using the Canvas Area section at the top of my site. I have a video playing in the background, which works really well on desktop. But on mobile video doesn't play without user interaction, so I have a static image in place as an alternate image. However when viewed on a mobile device there is now a play button over the static image that does nothing. This didn't use to happen so I imaging it is due to an upgrade. But this is really bad UX. Is there a way to remove it?
      Here is the site:
      Thanks in advance.