Page 3 of 5 FirstFirst 12345 LastLast
Results 21 to 30 of 47

Thread: Widgets For Dummies?

  1. #21
    Jeffro's Avatar
    Jeffro is offline WPTavern Forum Admin
    Join Date
    Jan 2009
    Location
    Ohio
    Posts
    2,358

    Default

    Quote Originally Posted by chipbennett View Post
    How does Jeff usually like those? Can it be a cross-post, or does he want original content only?
    I prefer if it's going to be a guest blog post, to be published on WPTavern only because of the duplicate content issue. However, I have no problem creating my own little post and linking to your site if you publish the article their. Also, if it's published on WPTavern.com you can publish an excerpt or what have you on your own site linking to it.

    I'm pretty sure the submission form will not work unless you say blue lol.

  2. #22
    JohnM's Avatar
    JohnM is offline Big Tipper
    Join Date
    Feb 2009
    Location
    Norway
    Posts
    346

    Default

    Outside the Tavern the sky is always blue ;)

  3. #23
    chipbennett's Avatar
    chipbennett is offline WordPress Legend
    Join Date
    Feb 2009
    Location
    St. Louis, MO
    Posts
    1,993

    Default

    Quote Originally Posted by JohnM View Post
    Outside the Tavern the sky is always blue ;)
    And Inside the Tavern the Skyy is always clear. ;)
    WP TurnKey - Turn-Key WordPress installation and maintenance services
    WordPress user since 2005 | @chip_bennett | chipbennett.net | cbnet Plugins

  4. #24
    chipbennett's Avatar
    chipbennett is offline WordPress Legend
    Join Date
    Feb 2009
    Location
    St. Louis, MO
    Posts
    1,993

    Default

    And now for a more advanced Widget question:

    How do I add an option to the widget, in which the user selects a category, and then the Category name is used as the Widget title, and the CatID is returned for other purposes?

    I would like the option to be something intuitive, like a dropdown list of categories.
    WP TurnKey - Turn-Key WordPress installation and maintenance services
    WordPress user since 2005 | @chip_bennett | chipbennett.net | cbnet Plugins

  5. #25
    dancole's Avatar
    dancole is offline Tavern Regular
    Join Date
    Jan 2009
    Location
    USA
    Posts
    237

    Default

    Quote Originally Posted by chipbennett View Post
    And now for a more advanced Widget question:

    How do I add an option to the widget, in which the user selects a category, and then the Category name is used as the Widget title, and the CatID is returned for other purposes?

    I would like the option to be something intuitive, like a dropdown list of categories.
    The function your looking for is wp_dropdown_categories();

    To make the Widget title and CatID the value people select, you just use the $instance['your_field_name'] within the widget function.

    EDIT:

    WPTavern just linked to http://wpseek.com, which is a nice site for looking up functions. I tested it with "dropdown categories" and it found the function I gave above.
    Dan Cole, Future Engineer.

  6. #26
    chipbennett's Avatar
    chipbennett is offline WordPress Legend
    Join Date
    Feb 2009
    Location
    St. Louis, MO
    Posts
    1,993

    Default

    Quote Originally Posted by dancole View Post
    The function your looking for is wp_dropdown_categories();

    To make the Widget title and CatID the value people select, you just use the $instance['your_field_name'] within the widget function.

    EDIT:

    WPTavern just linked to http://wpseek.com, which is a nice site for looking up functions. I tested it with "dropdown categories" and it found the function I gave above.
    Will that function work for linkroll (bookmark) categories?

    (Off to research at wpseek...)

    On second thought, I think I can modify the existing "Links" widget, to get what I'm looking for.
    Last edited by chipbennett; 08-21-2009 at 09:48 PM.
    WP TurnKey - Turn-Key WordPress installation and maintenance services
    WordPress user since 2005 | @chip_bennett | chipbennett.net | cbnet Plugins

  7. #27
    dancole's Avatar
    dancole is offline Tavern Regular
    Join Date
    Jan 2009
    Location
    USA
    Posts
    237

    Default

    Quote Originally Posted by chipbennett View Post
    Will that function work for linkroll (bookmark) categories?
    The function your looking for is: get_bookmarks();

    It's not exactly the same as the last function. You will have to generate the dropdown.
    Dan Cole, Future Engineer.

  8. #28
    chipbennett's Avatar
    chipbennett is offline WordPress Legend
    Join Date
    Feb 2009
    Location
    St. Louis, MO
    Posts
    1,993

    Default

    Quote Originally Posted by dancole View Post
    The function your looking for is: get_bookmarks();

    It's not exactly the same as the last function. You will have to generate the dropdown.
    Okay, so I'm having difficulty figuring out how to generate a dropdown using get_bookmarks()... any suggestions?
    WP TurnKey - Turn-Key WordPress installation and maintenance services
    WordPress user since 2005 | @chip_bennett | chipbennett.net | cbnet Plugins

  9. #29
    chipbennett's Avatar
    chipbennett is offline WordPress Legend
    Join Date
    Feb 2009
    Location
    St. Louis, MO
    Posts
    1,993

    Default

    And a related question: how do I return the unique instance id for a given instance of a widget? I assume it is something in the instance array ( $instance['something'] ), but I can't find any documentation on what 'something' might be.
    WP TurnKey - Turn-Key WordPress installation and maintenance services
    WordPress user since 2005 | @chip_bennett | chipbennett.net | cbnet Plugins

  10. #30
    chipbennett's Avatar
    chipbennett is offline WordPress Legend
    Join Date
    Feb 2009
    Location
    St. Louis, MO
    Posts
    1,993

    Default

    Quote Originally Posted by chipbennett View Post
    And a related question: how do I return the unique instance id for a given instance of a widget? I assume it is something in the instance array ( $instance['something'] ), but I can't find any documentation on what 'something' might be.
    I think I found it: $instance['id']

    Correct?
    WP TurnKey - Turn-Key WordPress installation and maintenance services
    WordPress user since 2005 | @chip_bennett | chipbennett.net | cbnet Plugins

Page 3 of 5 FirstFirst 12345 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •