I'm not at all familiar with Wordpress so please bear with me...I have a site on Wordpress. On the homepage is where I want to include an HTML form which would post to a it's own PHP processor. The form and the form processor are both separate PHP files. I would like to know how I can include the form in a specific DIV on my homepage. Any assistance is greatly appreciated.
Look inside the folder wordpress/wp-content/themes/twentyeleven/ for the files home.php or index.php.
If you want the form in the main content area that's where you need to put it (use an include to your PHP file).
If you want it in the sidebar there's a sidebar.php file you can check out.
If you change the theme twentyeleven be sure to rename the folder and open the style.css file and change the name in the css comments too. After that you can enter the wp-admin area and select the new theme from the appearance panel. You should do this so that any WordPress updates won't overwrite the files you change.
Related
I have a search form that is fetching some data from a database and then showing the data on a page on my website , I want to add this form to my Wordpress website , Not the wordpress search form , But the form I created .
What is the best way to include this search form and the PHP script ? Should I insert the html code directly to the header.php file that its action would be the PHP file that contains my script ? Or there is another better way?
I have the html code in an html file , and the PHP script , and Css file, What is the best way to include them to my wordpress website?
You can add it to your header file but you would lose those changes when you updated your theme.
The correct thing to do is to create a child theme, copy the header.php file from the parent theme to the child theme and change it there. There are a few of plugins that you can use to create child themes.
You should also add your css file to the child theme and enqueue that in the functions.php file in your child theme.
When you make the child theme the websites theme, Wordpress will use all of the templates in the main theme except for the header.php file.
Smashing pumpkins has a good tutorial.
I might get in trouble for asking this but I have been searching WordPress web directories and scouring the web.
I have not been able to find the file based on everything I have read so far.
I copied the contents of a template file called page.php and created a page called page-contact-us.php.
After editing this page, I uploaded inside the themes folder along with the same page.php file I modeled after along with several other files.
How do I find page-contact-us.php file when I log into my wordpress web app?
Thanks
When editing a page in WP-admin, there will be a box off to the right hand side (under the Publish area, typically) that holds a drop-down for selecting the Page Template to use for that page.
As long as you've set up the template comment at the top of the template file, your custom template should show up here. At the start of the file, include this:
<?php /* Template Name: Your Template Name Here */ ?>
I am new on wordpress and are using the themes as well. May I know where do I put a new file if let say main.php? I want to make a custom main page and replace the index.php page on the theme. Do I need to put it under htdocs\wordpress\wp-content\themes\<theme-name>. I am using this locally on my computer.
On my main.php, I also include css file. Where do I insert the css file as well?
you can set your front page in wordpress dashboard customization options
Go to Administration > Settings > Reading panel.
and select the page listing in dropdown , but before that you have to create a new page and select you custom page from dropdown . see the below image.
refer this for more info
you can have your css file keep on style directory of your theme and link it in your main page using
get_template_directory_uri() . '/styles/your-style-file.css'
You have to create page template for this.
Have a look over below thread hope this will help you
https://developer.wordpress.org/themes/template-files-section/page-template-files/page-templates/
I've created a search engine on localhost, but am now trying to move the files onto wordpress.
How exactly do I accomplish this with respect to the theme template files and the file manager? I have a search.html document to start off with which calls a search.php for results from MYSQL database.
Meanwhile, i also have a search.inc.php page for the autosuggestions that are also drawn from the database and come up as you type
I have tried inserting the search.html code into the header.php file.
The search bar and button are visible, but both the suggestions and the search results do not work. I have tried inserting search.php and search.inc.php in the same folder as the childtheme and the header.php to no avail.
What do I have to do with these files so that they can adequately communicate with my header.php?
Please create a page template file in your theme like :
<?php
/*
Template Name: My Custom Page
*/
and when you create a new page select this templete in admin panel.
now you can add any code what you want. this will communicate with you header file
for more details about page template visit :
http://codex.wordpress.org/Page_Templates
[NEW AT WORDPRESS]
I'm creating my own wordpress theme with own css etc etc. I've managed to get everything good in the index.php file, and I'm trying to make the other pages as well now.
When I make the home.php, blog.php, about.php and contact.php file (in my theme folder) they don't link to it. I'm following the "WordPress 3: Creating and Editing Custom Themes with Chris Coyier" on Lynda.com and the example shows that whenever you make a file with the same name as your page, it takes that directly (which works at his tutorial).
Anyone that could know what is going on?
Example:
I got a file blog.php in my theme folder, and when I go to www.mydomain.com/blog the loaded file is the index.php file, instead of the blog.php file
There are two ways you can get this working using custom page templates.
Create a template for one specific page using the page slug or ID. In this case, change the name of the php files like this to match the name of the page you created in the UI: page-home.php, page-blog.php, page-about.php and page-contact.php
Much more flexible is to create a custom template that can be used on ANY page. Just add the template name to the top of the php file like so (inside the php block):
/*
Template Name: My Home Page Template
*/
Then edit the pages and select your custom template from the template dropdown menu (on the right hand side I think, if its visible).
Reference this page for more info: https://developer.wordpress.org/themes/template-files-section/page-template-files/
Found the solution to my (silly) problem.
Creating a page in your theme directory & adding the template comment at the top of your php file isn't enough. You need to go to the admin panel->pages->YOUR PAGE-> and check out the page attributes. There you can link the page to a certain template: http://d.pr/i/a0m0