Jump to content


Photo
- - - - -

where to drop php code generated by a wp-plugin

slider php code

  • Please log in to reply
11 replies to this topic

#1 walter arrighetti

walter arrighetti

    Advanced Member

  • Members

  • 34 posts
  • Country: Country Flag

Posted 02 June 2013 - 05:24 PM

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: 

Please Login or Register to see this Hidden Content

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,



#2 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 02 June 2013 - 05:44 PM

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.



#3 walter arrighetti

walter arrighetti

    Advanced Member

  • Members

  • 34 posts
  • Country: Country Flag

Posted 02 June 2013 - 06:43 PM

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!



#4 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 02 June 2013 - 07:21 PM

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



#5 walter arrighetti

walter arrighetti

    Advanced Member

  • Members

  • 34 posts
  • Country: Country Flag

Posted 04 June 2013 - 05:49 AM

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?



#6 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 04 June 2013 - 02:05 PM

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?



#7 walter arrighetti

walter arrighetti

    Advanced Member

  • Members

  • 34 posts
  • Country: Country Flag

Posted 04 June 2013 - 02:37 PM

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

          



#8 James B

James B

    Advocate

  • Members

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

Posted 04 June 2013 - 08:58 PM

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 -

Please Login or Register to see this Hidden Content

 

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 -

Please Login or Register to see this Hidden Content

 

Then you can put your hook and php into the functions.php of either the base theme or the customise plugin -

Please Login or Register to see this Hidden Content

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.


  • walter arrighetti likes this

#9 walter arrighetti

walter arrighetti

    Advanced Member

  • Members

  • 34 posts
  • Country: Country Flag

Posted 05 June 2013 - 06:51 AM

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!

 

.



#10 Simon_P

Simon_P

    Messer

  • Administrators



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

Posted 05 June 2013 - 02:07 PM

Use the functions.php in your child theme.



#11 walter arrighetti

walter arrighetti

    Advanced Member

  • Members

  • 34 posts
  • Country: Country Flag

Posted 11 June 2013 - 03:57 AM

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...



#12 greenfly

greenfly

    Advocate

  • Members

  • 3268 posts
  • LocationManchester, England
  • Framework Version:latest
  • Country: Country Flag

Posted 11 June 2013 - 07:39 AM

Hello Walter. 

 

Install either the Pagelines Customization plugin from the store 

Please Login or Register to see this Hidden Content

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

Please Login or Register to see this Hidden Content







Also tagged with one or more of these keywords: slider, php code