Jump to content


Photo
- - - - -

This may be a generic WP question, but how do I write custom PHP code within my PageLines site?


  • Please log in to reply
1 reply to this topic

#1 sois

sois

    Advanced Member

  • Members
  • 40 posts

Posted 23 January 2012 - 10:59 PM

I used to design the site myself but once I found WordPress and PageLines, I have migrated everything to this environment. I still have old code I would like to use on this new site but I don't want to write directly into the PageLines theme. That seems just like bad practice. What element should I consider? For example, I had a custom banner coded on the top of my old site with the weekly leaders for my football league. How would you tackle that? A Box? A Banner? If I can wrap my mind around the best way to do this, It will help me going forward. Thank you all!

#2 kastelic

kastelic

    Advocate

  • Members

  • 3081 posts
  • Country: Country Flag

Posted 23 January 2012 - 11:39 PM

You use what are called hooks. For Framework, you would install Pagelines Cusotomize from the store and then in your plugins folder you will have that plugin that contains style.css and functions.php. All your custom code can go in functions.php and then told to be added to any of dozens of hook locations throughout the theme. The plugin Action Map (in the PL store) can show you exactly where all these hooks reside. In the legacy docs for PlatformPro there is a good introduction to how hooks work. The syntax is the same for Framework it just goes in a different place:

Please Login or Register to see this Hidden Content