Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am new to Wordpress but forced to create a website as a Wordpress template for my current employee (I am a front end developer, mostly build new systems/apps etc from scratch). Creating the template is no issue, but how do I go about making everything fully editable? For example the footer: it contains contact information and I would like information to be fully editable from within the Wordpress admin. Everything however seems to resolve around posts and articles... so, my first idea was to simply make posts and categorize those as "Footer" and then filter the displayed posts on the loop in footer.php by that category but that doesn't seem very logical. What is a more common approach? Widgets? If widgets is the answer, how exactly do those present themselves in the admin section?

Sorry for the long question :)

share|improve this question

2 Answers 2

up vote 1 down vote accepted

Another option is to create a new post type called "modules" or something to that effect. Then you can create as many of those as you like, for example, "Footer: Contact Information," "Footer: Social Media," "Header: Callout," etc, and you can use that post's ID to bring it into the designated spots in your template.

While the sidebar suggestion from Jacob is also good, if you have a lot of those one-offs, it can get pretty overwhelming to manage. By making it a post type, you can search it, you get a WYSIWYG editor, and you can add additional custom fields if needed.

share|improve this answer
    
I wasn't aware of custom post types. Those will definitely come in handy, also outside of my footer situation. Thanks! I'm going to read up on them. –  Galadre Mar 10 '13 at 21:36
    
One more quick question, I notice that I can register a post type named "acme_product" as in the codex but any other string will return an error (Invalid post type)? The function reference doesn't explain either. –  Galadre Mar 10 '13 at 21:53
    
Make sure you follow the specs: Max. 20 characters, can not contain capital letters or spaces codex.wordpress.org/Function_Reference/register_post_type –  NightHawk Mar 11 '13 at 5:58

Common practice is to use widgets. To do this you need to register a new sidebar which will show up in the widgets section.

funciton my_sidebars(){ 
 register_sidebar(array(
   'name' => __( 'My Footer' ),
   'id' => 'footer-widgets',
   'description' => __( 'Widgets in this area will be shown in the footer.' ),
   'before_title' => '<h1>',
   'after_title' => '</h1>'
 ));
}

add_action( 'widgets_init', 'my_sidebars' );

Then in your footer you can call the new sidebar widgets.

    <div id="footer" class="widget-area">
       <?php dynamic_sidebar( 'footer-widgets' ); ?>
    </div><!-- #secondary -->

Then you would just need to style the widgets with css to display in columns.

You can read more about registering sidebars here: http://codex.wordpress.org/Function_Reference/register_sidebar

share|improve this answer
    
Thanks for the sample code! I will read up on post types as NightHawk suggested and decide which best serves my requirements. Either way, you both provided valuable info. Unfortunately I cannot up-vote yet, since I only just registered here :( –  Galadre Mar 10 '13 at 21:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.