Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

PHP in wordpress

Posted on 2013-06-16
7
Medium Priority
?
415 Views
Last Modified: 2013-06-17
I have a PHP part generator that was created and now they are moving the site to wordpress.  How do I go about moving the generator to the wordpress site?  I moved the folder and the database.  The generator is currently at http://sagemetering.com/applicationsdata/ .  Currently I am having no luck getting this to work.  ANy help is greatly appreciated.

Thank you
0
Comment
Question by:solsticeint
7 Comments
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 39252124
Although that's not nearly enough info, I suspect that you won't get it to work as part of Wordpress.  At the very least, you would have to redesign the theme where the display code is and find some way to resolve the differences between your CSS and javascript and that used by Wordpress.
0
 

Author Comment

by:solsticeint
ID: 39252130
I was afraid of that.  Any suggestions would be most helpful.
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 39252137
There's no real magic to porting over PHP code to WordPress.  Most of the time you just need to make custom page templates and copy the code over to the template.  You can add custom CSS or JavaScript required to make things work in a number of different ways.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 39252199
Unless you convert your website design as Wp themes & features into WP functions. there is no easy way to do
0
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 2000 total points
ID: 39252225
Unless you convert your website design as Wp themes & features into WP functions. there is no easy way to do

This is just not accurate.  WordPress is made with PHP...normal PHP code runs fine.  The only things you need to be aware of are:

1) You have to embed your custom code in a template.  You cannot stick it in the visual editor.

2) You will need to globalize variables if you expect to pass data around

3) If your app has lots of javascript, you will want to use a WordPress function (wp_enqueue_script) to call it properly.
0
 
LVL 82

Expert Comment

by:hielo
ID: 39253210
>>The generator is currently at http://sagemetering.com/applicationsdata/
If I understand you correctly, the link above is from "Site A" (the soon to be old site) and you copied over the applicationdata folder to "Site B" (the WP site).

If that is the case, I would expect it to work if you access it as:
http://thenewsite.com/applicationsdata/index.php

Does it?  If yes, then try routing the requests for "/applicationdata/" to "/applicationdata/index.php" via the .htaccess file:

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/applicationsdata/?$ applicationsdata/index.php [NC,QSA,L]

# the rest of your rules follow

Open in new window

0
 
LVL 17

Expert Comment

by:jrm213jrm213
ID: 39253226
Hello,

You shouldn't need to change anything. Wordpress is just a content management system. As along as the Part Generator worked as a standalone item previously you should be able to create a directory in the root of your site called part-generator or something similar, place all of the code for the part generator into that folder, and then include the part generator in any page you want using an iframe.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses
Course of the Month20 days, 19 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question