Support » Plugin: WP Facebook Open Graph protocol » [Plugin: WP Facebook Open Graph protocol] Meta Description Issues/Improvements/request

  • Resolved Pinto

    (@rfcapinto)


    Hi,

    I’m using your plugin and there’s a feature i think a lot of people would be glad to see implemented.
    case1: user uses excerpt
    – the plugin shows the excerpt in lint
    case2: user does not use excerpt
    – the plugin uses the description in wp-settings

    now if the user does not use excerpt ( either auto or manual ), the og:description will not be relevant regarding the content of the post ( and there are people that do not use description in wp-settings)

    so a great feature would be:
    check for excerpt, if not available:
    plugin parses the_content and show the first 55 characters as og:description and in last case show description.

    an ugly “fix” i use at the moment is i’ve commented the
    // do descriptions code

    this way, lint will get the og:description from the first <p> it encounters

    Would love some feedback.

    Thank you for your plugin!

    Pinto

    http://wordpress.org/extend/plugins/wp-facebook-open-graph-protocol/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi

    You can do this hack into the plugin code. it works nice for me as i had the same problem as you had. Find the next piece of code in the plugin and change the bolded line :

    // do descriptions
                    if (is_singular('post')) {
                            if (has_excerpt($post->ID)) { // truncate_post($et_excerpt_length);
                                    echo "\t<meta property='og:description' content='".esc_attr(strip_tags(get_the_excerpt($post->ID)))."' />\n";
                            }else{
    				<strong>echo "\t<meta property='og:description' content='".get_bloginfo('description')."' />\n";</strong>
    
                            }

    with:

    <strong>echo "\t<meta property='og:description' content='".esc_attr(substr(strip_tags($post->post_content), 0, 255))."...' />\n";</strong>

    Oh well it seems that code tags with strong tags are not geting along well.

    Once again, change the first:

    echo “\t<meta property=’og:description’ content='”.get_bloginfo(‘description’).”‘ />\n”;

    with

    echo “\t<meta property=’og:description’ content='”.esc_attr(substr(strip_tags($post->post_content), 0, 255)).”…’ />\n”;

    You can also define how many characters to be displayed in the description. I wanted 255.

    Plugin Author Chuck Reynolds

    (@ryno267)

    Hey guys.. I don’t get notifications when ppl add support requests on here… :/ lame.

    Anyways – I never put a priority on that functionality initially as most people that beta tested for me were cool with customizing it, however I understand the desire for said functionality. Therefore this is scheduled for final testing currently in the beta I have and will very likely be included with the next update.
    So standby – and thanks for the support req.

    Chris

    (@eminemdrdre00)

    Thanks for this great plugin!

    Can we have the option to limit the description by word length with “…” at the end, rather than character count?

    Plugin Author Chuck Reynolds

    (@ryno267)

    @eminemdrdre00 what word length were you thinking. I made it 160 as to keep with the length that Facebook will display before cutting it off. I didn’t do the … as it’s annoying and also takes up more characters. IMO people should be crafting their own custom descriptions not letting an autogenerator do it for them – but that’s just me.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: WP Facebook Open Graph protocol] Meta Description Issues/Improvements/request’ is closed to new replies.