• Hey I was wondering if I could make the sidebar text widget unique for each individual Author? I’m creating a guest blogging site for my friends and I want to track the traffic that is going through the ads and keep track of the money generated by each individual author’s post.

    Can this be done with widget logic?

    http://ww.wp.xz.cn/extend/plugins/widget-logic/

Viewing 2 replies - 1 through 2 (of 2 total)
  • No, not with widget logic. You need a “context-sensitive” widget. Here’s an outline of how you could do that. (Though this is from old code – I suspect widgets are meant to be setup more sensibly with classes or something these days)

    function my_author_bio($args)
    {	global $wp_query, $userdata;
    	extract($args);
    	$author_obj = ($wp_query->post);
    	$author_obj= get_userdata($author_obj->post_author);
    
    	echo $before_widget . $before_title . "Author Bio" . $after_title;
    
    	if ($author_obj->user_description)
    		echo $author_obj->user_description;
    	else
    		echo "<p>No biography available.</p>";
    
    	echo $after_widget;
    }
    
    register_sidebar_widget('Author Bio','my_author_bio');
    Thread Starter kirk1069

    (@kirk1069)

    I would be putting an image in the sidebar and would want to track the traffic that goes through that image and track the sales and conversions, where would I put the image code?

    This might be a sweet idea for a plugin for guest blogging haha…

    Also I know nothing about coding.

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

The topic ‘Author Unique Sidebar’ is closed to new replies.