RSS for Yandex Turbo Shortcodes

Below, you’ll find a detailed guide on how to add the RSS for Yandex Turbo Shortcodes to your WordPress website, including their parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the RSS for Yandex Turbo Plugin shortcodes not to show or not to work correctly.

Before starting, here is an overview of the RSS for Yandex Turbo Plugin and the shortcodes it provides:

Plugin Icon
RSS for Yandex Turbo

"RSS for Yandex Turbo is a WordPress plugin designed to optimize your website's content for Yandex Turbo pages. It generates an RSS feed, making your site faster and more accessible."

★★★★☆ (134) Active Installs: 40000+ Tested with: 6.1.4 PHP Version: 5.3
Included Shortcodes:
  • [yt-permalink]
  • [yt-title]

RSS for Yandex Turbo [yt-permalink] Shortcode

The ‘yt-permalink’ shortcode is a part of the rss-for-yandex-turbo plugin. It retrieves the permalink of the current post or page in a secure manner. This shortcode applies the ‘the_permalink_rss’ filter to the get_permalink() function, ensuring the URL is safe for use in RSS feeds.

Shortcode: [yt-permalink]

Examples and Usage

Basic example – A simple implementation of the ‘yt-permalink’ shortcode that returns the URL of the current post or page.

[yt-permalink /]

PHP Function Code

In case you have difficulties debugging what causing issues with [yt-permalink] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode('yt-permalink', 'yt_permalink_func');

Shortcode PHP function:

function yt_permalink_func($atts) {
	return esc_url( apply_filters( 'the_permalink_rss', get_permalink() ) );
}

Code file location:

rss-for-yandex-turbo/rss-for-yandex-turbo/rss-for-yandex-turbo.php

RSS for Yandex Turbo [yt-title] Shortcode

The ‘yt-title’ shortcode is a function within the rss-for-yandex-turbo plugin. This shortcode retrieves and displays the RSS title of the current post or page.

Shortcode: [yt-title]

Examples and Usage

Basic example – An elementary usage of the shortcode to display the title of the current post or page in RSS format.

[yt-title /]

Advanced examples

As the shortcode does not accept any attributes, there are no advanced examples to be provided. The shortcode ‘yt-title’ will always return the title of the current post or page in RSS format, regardless of any parameters provided.

However, if you wish to modify the shortcode to accept parameters, you could modify the PHP function like so:

function yt_title_func($atts) {
    extract(shortcode_atts(array(
        'post_id' => '',
    ), $atts));

    if($post_id != ''){
        $title = get_the_title($post_id);
    } else {
        $title = get_the_title_rss();
    }

    return $title;
}

Then, you can use the shortcode with the ‘post_id’ parameter to display the title of a specific post:

[yt-title post_id=123 /]

PHP Function Code

In case you have difficulties debugging what causing issues with [yt-title] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode('yt-title', 'yt_title_func');

Shortcode PHP function:

function yt_title_func($atts) {
	return get_the_title_rss();
}

Code file location:

rss-for-yandex-turbo/rss-for-yandex-turbo/rss-for-yandex-turbo.php

Conclusion

Now that you’ve learned how to embed the RSS for Yandex Turbo Plugin shortcodes, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *