Sticky-Fields, a WordPress plugin to save and retrieve fields

September 11th, 2006 ericdes

You can now edit custom fields (content you use the most) from within the administration, such as a headline, proverb or phone number.

You retrieve a field content in your PHP template like this:

global $stickyfield;
echo $stickyfield->field['name-of-your-field'];

With this plugin, you don’t need to modify your templates each time you want to update some hard-coded text.

Download links:
Sticky-Fields 1.0 (.tgz)
Sticky-Fields 1.0 (.zip)

Entry Filed under: WordPress plugins

11 Comments Add your own

Pages: « 2 [1]

  • 10. Raymond Barglow  |  July 19th, 2007 at 8:38 am

    Can someone please explain to me whether the standard way of providing “stickiness” in a form — i.e. by using “isset() to test a $_POST variable, and then echoing the value of this variable to the screen if there’s something in it — can be made to work in a wordpress file like profile.php? If this method does not work, why not?

    As I mentioned in my previous message, I don’t understand how the sticky field plugin works, although I have installed it successfully. The Options screen for this plug in asks for field and “Value” info — but I don’t know what to enter for “Value.”

    Thanks for your help. As you can see, I’m a newbie at all of this.

    Raymond Barglow
    Berkeley

  • 9. Raymond Barglow  |  July 19th, 2007 at 8:14 am

    Gulp!

    The code in the comment I made a moment ago does not reproduce literally in the comment message that one submitgs. Sorry about that.

    I’ll send the code in an HTML message to the contact person for Tela-Web.

    Thanks,

    Raymond Barglow

  • 8. Raymond Barglow  |  July 19th, 2007 at 8:07 am

    Hello,

    I am building a community democracy website: http://www.gardendemocracy.org. I’ve added several street fields (one is named “streetaddress”) to the user profile record, and want to make population of these fields sticky.

    I’m trying to use stickyfields, but without success. I have several questions. First, when you go into the options screen and try to provide a field list for sticky fields, it asks for “Field”(which I understand) and “Value” (which I don’t understand). What goes into the “Value” field? I tried doing this for the streetaddress field, but couldn’t figure out what to put in the “Value” field.

    My second question is this: can you make available to me (and perhaps to others who also will appreciate this information) a fully worked out example of how this works in a php form file?

    Below is the php forms file I trid to get to work.

    Thanks,

    Raymond Barglow
    510-486-1050

    ******************
    code profile-new.php

    ” />

    />

    ” name=”submit” />

    user_login; ?>” disabled=”disabled” />

    first_name ?>” />

    last_name ?>” />

    nickname ?>” />

    display_name; ?>”>display_name; ?>
    nickname ?>”>nickname ?>
    user_login ?>”>user_login ?>
    first_name ) ) : ?>
    first_name ?>”>first_name ?>

    last_name ) ) : ?>
    last_name ?>”>last_name ?>
    “>

    first_name ) && !empty( $profileuser->last_name ) ) : ?>
    first_name.” “.$profileuser->
    last_name ?>”>first_name.” “.$profileuser->
    last_name ?>
    last_name.” “.$profileuser->
    first_name ?>”>last_name.” “.$profileuser->first_name ?>

    user_email ?>” />

    field[’streetaddress’]; ?>” />

    city ?>” />

    state ?>” />

    zipcode ?>” />

    description ?>

    caps) > count($profileuser->roles)):
    ?>

    caps as $cap => $value) {
    if(!$wp_roles->is_role($cap)) {
    if($output != ”) $output .= ‘, ‘;
    $output .= $value ? $cap : “Denied: {$cap}”;
    }
    }
    echo $output;
    ?>

    ” name=”submit” />

  • 7. tricky  |  February 7th, 2007 at 10:53 pm

    AWESOME plugin.
    It’s so flexible, could be used for anything. Congratulations! been searching for something like this forever!

  • 6. alan  |  January 17th, 2007 at 1:13 pm

    dang. i’m a big dummy. sorry i posted in the wrong post. i thought i was in the sticky menu post.

  • 5. alan  |  January 16th, 2007 at 4:24 pm

    Typo in the second li… sorry. That should be “selected”

  • 4. alan  |  January 16th, 2007 at 4:24 pm

    Is there any way to add css classes to the li’s?

    Example

    
    <li class="first">Item</li>
    <li class="seleced">Item</li>
    <li>Item</li>
    <li class="last">Item</li>
    

    This would Really make this plugin even better than it already is.

  • 3. Claude  |  December 27th, 2006 at 12:38 pm

    Hi

    I try to use this plugin under Wordpress MU but the “Sticky Menus” sub-panel under “Manage” doesn’t appear ? What can I do ?

    Thanks

  • 2. Alan Trewartha  |  November 14th, 2006 at 12:27 pm

    sorry, meant to add that other than that this was EXACTLY what I was looking for. this should be built into WP - little pre-canned phrases that can be called into the template as needed so they can be changed in the admin interface by “editors” who can’t access the template.

    We use it for “feature taglines”

  • 1. Alan Trewartha  |  November 14th, 2006 at 12:25 pm

    To get this working I had to add in an “unserialise” here (nr line 86)

    // This is the declaration and instantialization of object $stickyfield:
    if (!$stickyfield = unserialize(get_settings(’sticky-fields’))) {
    $stickyfield = new StickyField;
    };

    and it works nicer if you also add this in (nr line 191)

    if ($stickyfield->field) { foreach($stickyfield->field as $field => $value)

    and the extra closing } later on

Pages: « 2 [1]

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed