Skip to:
Content
Pages
Categories
Search
Top
Bottom

How do I include widgets in using code?


  • deanes02
    Participant

    @deanes02

    <?php groups_widget_groups_list($args); ?>

    I’m guessing that this code will output a list of my groups, and it kind of does. However I need to know what arguments it is expecting as it throws up an error otherwise.

    Also what are the arguments expected from these two

    bp_blogs_widget_recent_posts($args)

    bp_activity_widget_sitewide_activity($args)

    BTW I know I can add these functions through widgets but due to my hacking of the template that doesn’t work!

    Thanks!!!!

Viewing 3 replies - 1 through 3 (of 3 total)

  • danielfelice
    Participant

    @danielfelice

    Why don’t you create widgetized areas within your theme? That is probably easier and you will have more control over the widgets.

    Look here for more info on create widget ready themes

    https://codex.wordpress.org/Widgetizing_Themes

    Or is that the part that you tried and didn’t work?


    deanes02
    Participant

    @deanes02

    I really need to do a lot of research into widgets etc as I usually just hack around in the code to make everything work properly. Most widgets I have added to date I do through php code as I have found this to be more flexible. Maybe I should move towards the more user friendly way(?)

    Do you happen to know the arguments expected by the functions above? For this particular project I think it will be easier to add the widgets via PHP code.

    Thanks!!!


    Burt Adsit
    Participant

    @burtadsit

    The widgets you are talking about are not designed to be called from a template. They just don’t work very well for that situation. Perhaps you’d like to investigate the bp custom loops that use template tags. These are designed to be used in templates : https://codex.buddypress.org/developer-docs/custom-buddypress-loops/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How do I include widgets in using code?’ is closed to new replies.
Skip to toolbar