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 was wondering how I would create a custom tab and page for wordpress admin screen, and save its data. I want a ticker on my main page, and the <li> data would change whenever I have new information available. Instead of editing code directly, I was thinking of creating a category for it, click save, store the data , then use that for the ticker via wp admin page. It'll be a lot easier to log in there to do it. If i could figure out how to save an input field, i could just use that, since i'll be the only one changing altering the list of the ticker.

Any ideas?

share|improve this question
add comment

migrated from stackoverflow.com May 9 '12 at 4:47

This question came from our site for professional and enthusiast programmers.

1 Answer

You might consider the idea of creating a custom post type called ticker. On the custom post type, add a custom field (input field) and store it as the value. Then one option would be to use code of this nature in your homepage template:

<?php $args = array(
    'numberposts'     => 5, // how many posts will be in the ticker
    'post_type'       => 'ticker',
    'post_status'     => 'publish' ); ?>
<?php $posts = get_posts( $args ); ?> 
<?php foreach($lastposts as $post) : setup_postdata($post); ?>
    <div class="ticker">[custom ticker field]</div>
<?php endforeach; ?>

Before you can do that though, you would have to set up the custom post type. This is one of the most concise tutorials on making custom post types and adding fields to them. This article explains how to set up custom post types from scratch. http://thinkvitamin.com/code/create-your-first-wordpress-custom-post-type/

One of the args to pay attention to here is: show_ui (should we display an admin panel for this custom post type)

Or if you don't want to sort out all that code, you could try to use some combination of these 2 plugins: http://wordpress.org/extend/plugins/custom-post-type-ui/ http://wordpress.org/extend/plugins/custom-field-template

share|improve this answer
add comment

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.