Sascha_Foerster
Forum Replies Created
-
To change the behavior of publicize, I used this code in functions.php and it worked:
function fwp_jetpack_shortlink($syndication_permalink) { $short_link = get_syndication_permalink($ID); if('' == $short_link) return false; return $short_link; } add_filter('get_shortlink','fwp_jetpack_shortlink'); ?>
The problem with duplicates is still persisting.
Okay, I’m getting closer, but still it doesn’t work as expected:
I created a child theme with a “functions.php”.
There I added this lines:function fwp_jetpack_shortlink($syndication_permalink) { $short_link = get_syndication_permalink($ID); if('' == $short_link) return false; return $short_link; } add_filter('get_shortlink','fwp_jetpack_shortlink'); ?>
Can you give me a hint whats wrong?
Where can I add the mentioned code?
$url = apply_filters( 'wpas_post_url', wp_get_shortlink( $post->ID, true ), $post->ID, $this->slug );
I tried to add this line of code to functions.php with this plugin:
https://www.ads-software.com/plugins/functionality/
Then I got this error:
Fatal error: Using $this when not in object context in /usr/www/users/…./wp-content/plugins/functions.php on line 13I tried to search this line of code in
/wp-content/plugins/jetpack/modules/publicize/publicize.phpThen I added it at several places in the same file, without any result.
I also tried several other plugins, but I really didn’t find a good place where to add this line of code. ??
To make my question clear: I want to tell only Jetpack Publicize to use “the_syndication_permalink” for social media postings, without changing shortlinks and permalinks in general.
So in short: How can I change the URL in Jetpack Publicize?