Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Broobe

    (@broobe_dev)

    Hi!

    If you are using a wordpress menu, just add the custom link.
    If you mean the admin bar menu, it’s already added (it’s a submenu)

    Thanks for using social articles!

    Author can you tell me which variable we use to Get User id in custom link url like
    if we add link of new articles in Custom Nav bar then

    http://purwebsite/members/admin/articles/new/

    But in case there is a user with name ronny or danny then which varible we use to get

    http://purwebsite/members/userid/articles/new/

    Plugin Author Broobe

    (@broobe_dev)

    Hi!

    Buddypress doesn’t work with that url structure (using userid). You have to get the user domain using a bp function. Something like that:

    bp_core_get_user_domain($userid).'/articles/new/'

    Let me know if it helps.

    Could someone explain where that code have to paste and also what else have to do after that to get this “add article” link working?

    Well this aint working:

    <a href="bp_core_get_user_domain($userid).'/articles/new/'">create article</a>

    Maybe you know better how it get to work?

    Place this in functions file. Then link to /articles/postarticle/ or whatever you want the link to be.

    function redirect2profile(){
    	include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
    	if($_SERVER['REQUEST_URI'] == '/articles/postarticle/' && is_plugin_active('buddypress/bp-loader.php') && is_user_logged_in()){
    		global $current_user;
    		wp_redirect( get_bloginfo('url') . '/'. $current_user->user_login . '/articles/new');
    		exit();
    	} else {
    		if ($_SERVER['REQUEST_URI'] == '/articles/postarticle/' && is_plugin_active('buddypress/bp-loader.php') && !is_user_logged_in()) {
    		wp_redirect( get_bloginfo('url') . '/wplogin?action=register');
    		exit();
    		}}
    
     }
    add_action('init', 'redirect2profile');

    rubybebin

    (@rubybebin)

    i have installed social article and buddypress plugin. Now i am not getting from where i can add articles.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘posting new article’ is closed to new replies.