Support » Plugin: Image Feed Widget » Image Feed Widget works well with extra function.php code

  • Problem: I needed to syndicate my one blog’s (site 1)categories as two separate feeds. I needed to include images in the feeds as well. These feeds needed to be “imported” into my other blog’s (site 2) sidebar.

    Solution: in site 1’s function.php file I added the following code found on this website: :

    function wpbeginner_postrss($content) {
    global $wp_query;
    $postid = $wp_query->post->ID;
    $coolcustom = get_post_meta($postid, ‘coolcustom’, true);
    if(is_feed()) {
    if($coolcustom !== ”) {
    $content = $content.”

    else {
    $content = $content;
    return $content;
    add_filter(‘the_excerpt_rss’, ‘wpbeginner_postrss’);
    add_filter(‘the_content’, ‘wpbeginner_postrss’);

    I modified for my own custom field.

    On site 2 I used the image feed widget to import the two feeds. But I had to be sure to use the following feed url(s):

    i initially didn’t use the …/feed/rss and the feed wouldn’t import the custom field image I had set up. by including the trailing …/rss at the end of the feed url it worked perfectly.

  • The topic ‘Image Feed Widget works well with extra function.php code’ is closed to new replies.