Archived

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

  • 0

where to drop php code generated by a wp-plugin


Question

Posted · Report post

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

11 answers to this question

Posted · Report post

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

Posted · Report post

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?

Share this post


Link to post
Share on other sites

Posted · Report post

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

Posted · Report post

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.

1 person likes this

Share this post


Link to post
Share on other sites

Posted · Report post

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

Posted · Report post

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/

Share this post


Link to post
Share on other sites

Posted · Report post

Great!

 

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

Posted · Report post

Use the functions.php in your child theme.

Share this post


Link to post
Share on other sites

Posted · Report post

Hi,

 

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.

Share this post


Link to post
Share on other sites

Posted · Report post

yes,

 

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

Posted · Report post

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

Share this post


Link to post
Share on other sites