Skip to:
Content
Pages
Categories
Search
Top
Bottom

Editing the blog loop

  • Avatar of Toby Cryns (@themightymo)
    Toby Cryns
    Participant

    @themightymo

    Hello!
    I would like to change the url in the blog loop link to “http://link.to.blog/category/blog” rather than “http://link.to.blog”.

    Should I add an action to the action hook, “bp_directory_blogs_actions”? If so, could you push me in the right direction as to how to do that? I have added actions before on the theme side, but those have been well-documented hooks. I am still a beginner in this area.

    `
    add_action (‘bp_directory_blogs_actions’, ‘my_change_url_function’);

    function my_change_url_function () {
    //What code goes here?
    }
    `

    Thanks in advance for your help!

Viewing 1 replies (of 1 total)
  • Avatar of Boone Gorges
    Boone Gorges
    Keymaster

    @boonebgorges

    Check out bp-blogs/bp-blogs-templatetags.php. Those are generally the functions that are called directly in the blog loop.

    In your case, you’ll want to filter bp_get_blog_permalink. Something like:
    `function my_change_url_function( $permalink ) {
    return $permalink . ‘/category/blog’;
    }
    add_filter( ‘bp_get_blog_permalink’, ‘my_change_url_function’ );`

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.