July 25, 201412 yr Hey! So I'm trying to to create a theme for a wordpress site. But I'm hard coding all the elements into the .php files. Im trying to incorporate Foundation 5 also. I'm thinking this is probably wrong? How else can I make the content from the admin area fit the code I'm implementing so that the client can easily update it? Seems all too confusing.... Any advice, help or guidance is appreciated! Thanks
July 27, 201412 yr Instead of hardcoding content in your theme files you can use wordpress functions to get the content from the database (posts,comments etc) Here's a list of functions to get the cms content into a page: http://codex.wordpress.org/Function_Reference The functions are not limmited to selecting entries from the database. There's a lot of useful widgets you can access with the wp fuctions. As an example: Say you want a search field in your footer you just call one single function and the search bar will appear. <div id="my_wp_footer"> <?php get_search_form(); ?> </div> Note that the functions that displays database content must be called from within "The Wordpress Loop" This loop is a php while loop and you can find it in in all pages that displays posts, categories and comments the loop usualy looks something like this: while ( have_posts() ) { the_post(); //function to display a wp post } Here is a full guide to "The Loop". http://codex.wordpress.org/The_Loop BTW I would recommend to start by creating a child theme from an existing theme. That way you only have to create the CSS, HTML and PHP that you want to modify. The rest of the code will be inherited from the parent theme. You can read about childthemes here: http://codex.wordpress.org/Child_Themes Edited July 27, 201412 yr by Nillervision
Create an account or sign in to comment