WordPress.org

Forums

Custom Post Widget
[resolved] Custom class or id (8 posts)

  1. Vayu Robins
    Member
    Posted 4 years ago #

    Hi.

    This is just a request and not a problem. Thanks for sharing this great plugin by the way.

    I think it would be great if it was possible write / add a custom id og class for each block.

    I know an auto generated id is created, but it's not as flexible as the ability to write my own class / id.

    Just a tip. :-)

    Thanks
    Vayu

    http://wordpress.org/extend/plugins/custom-post-widget/

  2. Johan van der Wijk
    Member
    Plugin Author

    Posted 4 years ago #

    Hi Vayu,

    I will consider this feature for a future upgrade. Because I don't want to make configuring the widget more complex I could add a class based on the title of the custom post type in the widget, would that help?

  3. Vayu Robins
    Member
    Posted 4 years ago #

    Hi Johan.

    Thanks for taking this into consideration. :-)
    I understand. I guess that could be an option, however, not so good if the client should chose to change the title, which is more likely to happen than if there was a class/id input field.

    Cordially
    Vayu

  4. wlanni
    Member
    Posted 4 years ago #

    Hello to both of you.

    I was searching for this exact topic: how to add a custom class, and/or add a unique id, so I can target a re-used custom post block on multiple pages and style them identically, AND have the confidence that when I'm done working on developing on my server, and pass this off to a client, that the ID will remain the same. (will it? have you ever tried that?)

    Adding a class that matches the title would definitely help!!!

    I could also wrap my content in my own html, but that is adding extra mark-up that I'd like to stay away from.

  5. wlanni
    Member
    Posted 4 years ago #

    Hey Vayu,

    I did a further search to just try to filter the custom-post-widget classes, and found this plugin.

    Installed it, it totally works.

    http://wordpress.org/extend/plugins/kc-widget-enhancements/

  6. Johan van der Wijk
    Member
    Plugin Author

    Posted 3 years ago #

    Hi Wlanni, thanks for sharing your solution!

  7. katart17
    Member
    Posted 3 years ago #

    I recently modified this widget to allow for a custom class within the shortcode.

    You can see it here: http://pastebin.com/2MeuBwLT

    I hope this helps and I would like to see this implemented in a future release.

  8. Johan van der Wijk
    Member
    Plugin Author

    Posted 3 years ago #

    Thanks for sharing your code, I have included it in the plugin!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Custom Post Widget
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic