Introduction:
At this moment I’m creating my first custom WordPress theme. Now I succesfully created a HTML/CSS template and converted this to fit wordpress (including header.php, index.php, footer.php, functions.php, sidebar.php and page.php).
Case/Problem definition:
At my homepage (index.php), I included several div’s filled with text (pure HTML and CSS). Now I want to be able to manually change this text from an admin panel in my WordPress Back-end. I already made an extra sub-menu page in the admin panel. This page is completely blank at this moment.
In Short:
How to fill in a text form in my WordPress admin panel and echo this out on a certain page (front-end).
Extra
Since I’m new to WordPress, PHP and creating your own themes I’m not sure how to do this or how to search for tutorials online (I don’t know the correct terminology to search).
Thanks for all the tips and advice already!
In your
functions.php
add the following code that is highlighted. This will add a twitterid. So anywhere in your custom theme you can call the value of the custom admin page:add menu item:
Assign the custom function which will create a form.
Create a Function Which Generates the Form:
View your admin page. You will find a new link in your Admin Menu called âGlobal Custom Optionsâ. Just enter your values in that form and you are good to go for using those values in your theme files like âget_option(âtwitteridâ)â. So, in your index.php or any other theme file, you can do something like
and it will print whatever value is in the textbox on admin page.
Here is a link to the tutorial for reference.