bbonev
Forum Replies Created
-
Hi @efra_zorrito, you can put it in your theme’s functions.php
What this code does is it creates a new row in the wp_postmeta table with value = $title. The key (‘_wpas_mess’) is usually used to store the contents of the Custom message field and the code just creates the row upon post save/publish/delayed publish. When jetpack sends content to facebook for publishing, it checks if such a field exists and uses it.
I haven’t tried what is posted to facebook if I actually enter something in the Custom message field, because the site I use this code on has a lot of content that is usually not published by me and nobody on the team is willing to post a custom message for 20+ articles posted daily.Let me know if this code works for you ??
A workaround for publicize posting the whole article on facebook:
function set_title_publicize () { global $post; $title = get_the_title( $post->ID ); update_post_meta( $post->ID, '_wpas_mess', $title ); } add_action('the_post', 'set_title_publicize'); add_action('save_post', 'set_title_publicize'); add_action('draft_to_publish', 'set_title_publicize'); add_action('new_to_publish', 'set_title_publicize'); add_action('pending_to_publish', 'set_title_publicize'); add_action('future_to_publish', 'set_title_publicize');
Put this code in functions.php and post title will show instead of whole text next time an article is posted on facebook.
Thanks a lot!
Anybody got idea in which file is this function defined? I need to edit the output, because the event title is sometimes too long.
Forum: Plugins
In reply to: how to open post when a category is clickedSend me the theme and I may be able to help you. You can get my e-mail from my profile.