You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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...!!!
The text was updated successfully, but these errors were encountered:
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 infunction.php
apply a hook to handled custom template for rss feed like below -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 templatefeed_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...!!!
The text was updated successfully, but these errors were encountered: