Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Wordpress CMS - Advise?

Featured Replies

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

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 by Nillervision

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.