• Hi,

    First let me thank you for this great plugin.

    I found an issue when I am trying to display the share buttons in my blog page, where I am displaying multiple posts (just a few lines and a “read more” link).
    I want my buttons in each post byline so I am adding the [ssba] shortcode to the byline code.
    The buttons are displayed for each post in my page but….
    The issue is that the share buttons take the url from the page and not from the post…
    I looked inside the plugin code and found the problematic logic here:

    // if running standard
    			if ($booShortCode == FALSE) {
    
    				// use wordpress functions for page/post details
    				$urlCurrentPage = get_permalink($post->ID);
    				$strPageTitle = get_the_title($post->ID);
    			}	else if ($booShortCode == TRUE) { // if using shortcode
    
    				// if custom attributes have been set
    				if ($atts['url'] != '') {
    
    					// set page URL and title as set by user
    					$urlCurrentPage = (isset($atts['url']) ? $atts['url'] : ssba_current_url());
    					$strPageTitle = (isset($atts['title']) ? $atts['title'] : NULL);
    				} else {
    					// get page name and url from functions
    					$urlCurrentPage = ssba_current_url();
    					$strPageTitle = $_SERVER["SERVER_NAME"];
    				}

    Any advice how to resolve it ?

    Thank you

    http://ww.wp.xz.cn/plugins/simple-share-buttons-adder/

The topic ‘Different logic for short-code usage doesn't work well in some cases’ is closed to new replies.