Support » Plugin: Simple Share Buttons Adder » Page title not being picked up by Twitter…

Viewing 8 replies - 1 through 8 (of 8 total)
  • I have the same issue.

    +1

    Same here, it’s very annoying :s

    The twitter title is not being picked up properly when you use the shortcode. I have worked around the problem by adding both url and title in the shortcode:
    <?php
    echo do_shortcode(‘[ssba url=”‘.get_permalink().'” title=”‘. get_the_title().'”]’);
    ?>

    You must include the url to have it pick up the title string – another problem that needs to be fixed. Here is the section of the plugin that needs to be cleaned up. Why does it only get the title/url from wordpress if $booShortCode == FALSE?
    // 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 (isset($atts[‘url’]) && $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”];
    }

    Thank jjwalker, for the time being it solves the problem of twitter title.

    Thanks jjwalker,
    your php code was the solution to pull excerpt titles and links

    Plugin Author Simple Share

    (@davidoffneal)

    Hi all,

    I’ve tidied this section of the code up now:

    // 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 { // using shortcode
    
    	// set page URL and title as set by user or get if needed
    	$urlCurrentPage = (isset($atts['url']) ? $atts['url'] : ssba_current_url());
    	$strPageTitle = (isset($atts['title']) ? $atts['title'] : get_the_title());
    }

    Essentially – If you’re not using shortcode, it sets the URL and title automatically, if you’re using shortcode it’ll do the same, or use either the URL or title as you have specified. This shall be in the next version released soon.

    Thanks,

    David 🙂

    when using the shortcode for the homepage, it pulls mysite.com instead of mysite.com/article. so where it says

    $urlCurrentPage = (isset($atts['url']) ? $atts['url'] : ssba_current_url());

    Just replace it with

    $urlCurrentPage = get_permalink($post->ID);

    and it will pull the link of the article instead of mysite.com

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Page title not being picked up by Twitter…’ is closed to new replies.