Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom RSS feed for custom post type not working with qtranslate-slug plugin #136

Open
Ishanjn opened this issue Apr 1, 2017 · 0 comments

Comments

@Ishanjn
Copy link

Ishanjn commented Apr 1, 2017

There is some issue with custom rss feed after installing "qtranslate-slug" plugin. I customised rss feed url to include my custom post type. I added custom post type into standard feed URL ex. http://www.example.com/feed/?post_type=custom_post_type and in function.php apply a hook to handled custom template for rss feed like below -

remove_all_actions('do_feed_rss2');
add_action('do_feed_rss2', 'custom_feed_rss2', 10, 1);
function custom_feed_rss2($for_comments) {
$rss_template = get_template_directory() . '/feed_custom_post_type.php';
if (get_query_var('post_type') == 'custom_post_type' && file_exists($rss_template))
load_template($rss_template);
else
do_feed_rss2($for_comments); // Call default function
}

As you look into code, i tried to get query string value using get_query_var('post_type'); but it's returning empty string. Also in template feed_custom_post_type.php i didn't get all post for this post type.

Can you please help me to resolve this problem?
A bunch of thanks in advance...!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant