Using PHP with Wordpress - php

I am currently trying to develop a website for fun just to practice. I have written some PHP code locally on my computer together with some css and html. My question is if anyone is familiar with Wordpress? And if so, am I able to import my php files and css into wordpress and use both code and the tools that wordpress has?
Thanks in advance!

Absolutely yes. The first thing you should do is create a child theme.
In it, you will have a style.css file in which you can add all your custom CSS.
Also in there will be a functions.php file. You can add custom PHP in there.
If you're looking to do something more complicated, then look into writing a plugin.

You can create templates on WordPress.
How to create a template
On this template, you can save your PHP.
To add CSS to WordPress you can do that by going to Appearance > Customize > Custom CSS.
The path to your Custom CSS section may be different depending on what theme you use.

Related

How to add custom div (+php) code to wordpress site

I am very new to wordpress. But have good knowledge in php, html, css and javascript.
I want to add custom font-resizer to my wordpress site. as shown below for example.
What would be the best and non-messy way to add the plugin code to my website.
I have looked at some tutorials online but it seems that I can't getting those.
Any help would be appreciated. thank you..
If you're trying to add that plugin specifically to your site, then its documentation suggests:
adding it through a widget that the plugin creates
or using this bit of code wherever you want in whichever template file: <?php if(function_exists('fontResizer_place')) { fontResizer_place(); } ?>
Does your theme have a place for widgets in its header? If not, you'll want to just place that bit of PHP somewhere in your header.php file.

Need help for PSD To WordPress using Thesis framework

I'm experienced developer and know very well how to convert PSD To HTML/WP. I have been using Woo Canvas framework to convert PSD to WP. But Now, I need help how to properly convert PSD to WordPress using Thesis framework.
Thesis framework is bit different since it uses "Skins", "Boxes" and etc to customize a site. I want few things to confirm from people how know Thesis framework.
Here is the png version of PSD file
http://screencast.com/t/JujlDjZm1Jwr
You can see, it has top header menu, header image, slider, menu, posts and sidebars.
Now my questions are:
How to properly perform customization without disturbing core framework files?
Should I be working on Skins, child theme and boxes?
Would I need to add some custom template integration?
I think, Thesis framework doesn't provide slider feature so I guess, I would need to add custom markup to add the home page slider?
How to create separate sidebar and that should be customizable?
I can see there are several options that I can set but it is not fulfilling the whole requirement.
I can go directly adding divs for each section and registering wp_nav but I first wanted to hear from some Thesis framework experts. I would be very thankful for any of your help! Thanks
Based on the date of this post I am assuming you are using Thesis 2.1x. This version of thesis does not require you to do any programming to accomplish any of the tasks that you asked about above. You can use the Custom CSS Tab on the Thesis Admin Page to add your custom CSS. You can also use the CSS editor to add CSS and create variables (Thesis is SASS ready).
To add a slider just use an HTML Container and add your slider to either a widget or Feature Box.
You can add Javascript to specific templates by clicking the gear icon next to the Template Button in the HTML editor.
If you really want to use your own code you can add skin specific php to your wp-content/thesis/custom.php file (same as wp functions.php) and you can use master.php to add code to every site on your network (wp-content/thesis/master.php). And of course you can enqueue and register scripts that you create in either of these files, as well.
I usually create a custom folder and keep all my function/js/class files in there and then just include of require them using the THESIS_USER_SKIN_URL constant. This constant enables Thesis to find your file within a specific skin.
The Thesis Forums are probably the best place to find Thesis answers. They have a great community.

Theme integrated to plugin wordpress

i am writing a wordpress plugin and i want to make some changes on appearence of site.How can i change some html and css with my plugin?
What i mean is this:I do something with my plugin and i have some result with that.I want to add some css and make it beautiful.Where i want to make change is home screen.How can i do that?
For example,a theme's div class name is foo,another one is hoo.
Now when i want to prepend something to that div there is no similiarity.So i decided to write a little theme which is integrated to my plugin.
With another word,i want to change theme automatically by my plugin.Is that possible?
You can add new 'CSS' and 'Javascript' in header of you website using
<?php
add_action('wp_head', 'your_function');
?>
In that CSS file you can create whatever CSS classes you want. And yes this can be accomplished using plugin (But not recommended).
You will need to read a little bit about things like:
https://codex.wordpress.org/Writing_a_Plugin
http://www.onextrapixel.com/2009/07/01/how-to-design-and-style-your-wordpress-plugin-admin-panel/
http://wp.tutsplus.com/articles/how-to-include-javascript-and-css-in-your-wordpress-themes-and-plugins/
Good luck and eventually let us know please :)

How create a Wordpress template through a HTML/CSS page?

I would like to learn about wordpress.
Is possible to create a wordpress template through a HTML/CSS page ?
I'm taking an easy HTML page to start, so I install the XAMPP and then the lastest Wordpress.
Any help is very welcome.
Thank you very much.
ps: I'm searching something in Google though.
I'd recommend learning a bit of PHP since it really helps making your way around Wordpress files. Makes life a lot easier even if you're mainly editing HMTL/CSS.
Install Wordpress
Copy the defaut theme folder (twenty elevent) inside /wp-content/themes
Rename the folder to your theme
Open style.css inside it and change meta information in the header file
Edit away the php/style sheets as you like to modify the theme to match your style
header.php - contains the common header code, usually navigation etc (Edit everything but dont remove wp_header. You will need that tag for wordpress to work, same for wp_footer in footer.php)
index.php is the main content file, sidebar.php is the sidebar
But you can use all these files as you please, its normal php/mysql stuff.
This is very useful too - http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates

How to integrate HTML pages into WordPress?

I have a page in HTML(index.html), and a folders named images, css, js that used in it.
Now i have to do this in WordPress. Is there any plug in to convert Html to WordPress or any other way to do this in WordPress? Please help me.. i'm a beginner in WordPress.
I am not sure of a direct way to implement a HTML page into a WordPress theme, but if you have made header and footer files for your website, then all you need to do is convert them to make them WordPress compatible.
You should refer to the codex.
You can also go for any of the WordPress frameworks listed here.
A WordPress theme is easy to understand if you know basic PHP. It has a set of files like
header.php // header file
footer.php // footer file
index.php // the index file
page.php // for your WP pages
single.php // for your WP posts
and some other files
Go through the codex and it shouldn't take long to get the hang of it.
You need http://themematcher.com/
It'll automatically take your site, styles, images etc and create a wordpress theme for you. Check it out
Search for HTML to WordPress theme conversion and you can find so many good tutorials.
Check this article:
http://thethemefoundry.com/blog/html-wordpress/
Theres really only three ways:
Hire a freelancer
Convert manually by referring to http://codex.wordpress.org/
Use an automated converter. Best one on the market is
https://htmltowordpress.io
here is the link for complete solution of this problem.
http://wordpress.org/support/topic/how-to-integrate-htmlphp-page-to-wordpres?replies=6
make sure to add
/*
Template Name: Custom Page Template
*/
piece of code in index.php page at top in your selected theme folder, not on ur main index.php file.

Categories