Jump to content

Archived

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

jeomiland

Custom PHP in platform5?

Recommended Posts

jeomiland

Hi guys

Hopefully an easy question. I have some custom code included in a Next section in a DMS site that I'm converting to platform5. What is the easiest way to insert my code into a "section" which I can easily add to my page structure with the platform5 page editor? I have the Embed extension but that takes javeascript, and my PHP test failed. Also have the Shortcodes extension, but looks like that only inserts objects into the WP-loop? and again, how to create a Hook that can go here?

thanks...

Share this post


Link to post
Share on other sites
chrisayers

This suggestion from Simon might help you.

Share this post


Link to post
Share on other sites
jeomiland

thanks chris - it helped.
Ya can't do PHP now it seems without altering the shortcodes.php file - but does that file get wiped when you update Core Wordpress software?  Does a new file overwrite the old one in which you make your code? (which happens often... sometimes automatically which would be a big problem to custom code! Yes?)

Themes, of course, have child themes to deal with this. Is there a "child core file" capability that let's you add code that stays on updates???

Share this post


Link to post
Share on other sites
chrisayers

There is a basic child theme in extensions. Please keep in mind that you may you use nearly any WP theme with PL5. 

Homepage with PL framework theme.

image.thumb.png.889c40621629195597d262c5beca48a2.png

 

Homepage with Twenty-Sixteen

image.thumb.png.bd89e1568d0bbefdb19cdc3e58e14021.png

Homepage with Twenty Fifteen

image.thumb.png.5f79b6c0533be28c6d264bb5437874e1.png

Share this post


Link to post
Share on other sites
jeomiland

hi chris - appreciate you taking the time to reply>

Still, it seems you are suggesting one can simply put code into a child theme that will later become a shortcode that can be instered on a page? If so, how go about this? Do you simply add code to a functions.php file in the child theme?

Will appreciate a little more detail.

Again, trying to create PHP code I can use on a page.
I assume can somewhere, somehow create a shortcode?
research indicates one can make a change to the wp-includes/shortcodes.php file, bu that get's wipped out with Wordpress updates - right?
So how do you put that code into a child theme? (what function file name, and an example will be helpful

thanks!

Share this post


Link to post
Share on other sites

  • Similar Content

    • KathleenAspenns
      By KathleenAspenns+
      I would like to upgrade my site to PHP 7, but there is an error warning in the PL Framework theme. I should think this should be fixed asap, I cannot be the only person trying to be up to date.
      1976 | ERROR | preg_replace() - /e modifier is deprecated since PHP 5.5 and removed since PHP 7.0
       
    • Dan Haddock
      By Dan Haddock
      DMS: Latest Version
      Running a Child Theme
      Wordpress: 4.8.3
      Plugins:
      Akismet Anti-Spam 
      Coming Soon Page & Maintenance Mode by SeedProd
      Contact Form 7
      Cookie Law Info
      DMS Professional Tools    
      Enhanced Media Library
      Flamingo
      Google Analytics for WordPress by MonsterInsights
      Google XML Sitemap    
      Jetpack by WordPress.com
      Legull
      Loginizer   
      MailChimp for WordPress
      PageLines Updater
      Really Simple SSL
      Schema App Structured Data
      Sucuri Security - Auditing, Malware Scanner and Hardening  
      Uber reCaptcha
      Yoast SEO
      Problem Below
      Hi Team,
      I am looking to style the Continue Reading Button with the PHP you provided in an earlier ticket here: 
       
      I put the PHP code into my site, however I do not get my Icon back, I just get back Read More >>
      I have attached a screenshot of the code in place on my site along with the output.
      Interested to know what I may be doing wrong? - I am very new to PHP so a bit apprehensive on this.
      The Images: https://drive.google.com/open?id=0B0i4JJXa2jdQN2xoakZNRUdmaU0
      Let me know if you need any more information from me.
       
    • casseysdesigns
      By casseysdesigns+
      In the past I would use nextbox for this task. However, Platform 5 does not have nextbox. I will do my best to describe what I am trying to do.
      I am creating a template for coaches, each product has its own link but they all share a common coach id. I want to set up the templates with the links for each product with a variable for the coach id so that I can change the coach id for all the links on the site by just changing the value of the variable $coachId. To do this I'll need to do something like the following...
      <a href="salesite.com/productcodes/referringRepId=<?= $coachId ?>" target="_blank">Product Purchase Link</a> Is it possible to do this with Platform 5?
    • janpeeters
      By janpeeters
      I read a lot lately about how much faster PHP 7 is than older versions. Is PL5 compatible with 7?
      Does anyone have experience with running their whole PL5 site on PHP 7? Would love to hear your experiences.
      Thanks, Jan
    • dymond
      By dymond+
      I've been trying to upload a video to use as a video background, but the size was 12m, and the alotted max file size is 8m. I downloaded a couple of pugins that increase the size by creating php.ini files and all of that jazz, but to no avail. It would say (Max file size = 250mb) but after I uploaded I would get an "HTTP ERROR",
      Soooo I logged into my cpanel and saw that the php I was using was 4 version out of date. I upgraded my php to PHP 5.6 and now I get
      Fatal error: Out of memory (allocated 39583744) (tried to allocate 15 bytes) in /homepages/39/d200014696/htdocs/dymondentertainment.com/wp-content/themes/dms/dms/includes/less.plugin.php on line 848
      When I activiate another theme that is not pagleines, the site works fine.... but will no longer work with Pagelines DMS Version 2.2
       
      My site has no gone dark. What can I do?
×