Skip to content

Add Widget for likebutton #56

@williamchong

Description

@williamchong

@john970473 We can continue the discussion here

Someone asked me how to add LikeCoin to the widget. I have tried to add the shortcode on the text widget but I failed because "likecoin_add_likebutton()" is just for posts or pages. Therefore, we could change the function and add the button to the widget.

At this moment, I could only add Javascript to the widget, but the style of the button looks not so good.
You can see the widget of my blog : https://www.johntool.com.
I think the button is too small, and I have to split url and add to link.

I think we can refactor a bit and let likecoin_add_likebutton() accept a $post or $likerId.

Then from inside a widget we can use get_queried_object to get the $post id/object.

For cases other than a post, we can use the site LikerId ($option[ LC_OPTION_SITE_LIKECOIN_USER ]) if it exists, and probably just hide the widget if it is not.

Did I get your idea right?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions