Skip to:
Content
Pages
Categories
Search
Top
Bottom

Dynamic Feed Urls for Feed Templatetag

  • Avatar of Nm
    nm
    Participant

    @nahummadrid

    Is there a best way you could suggest for how to insert dynamic url into the feed tag.
    I have different feed urls listed on the single.php for different posts. This is what I’ve tried so far.

    `ID, ‘url’); ?>

    `

Viewing 6 replies - 1 through 6 (of 6 total)
  • Avatar of imath
    imath
    Moderator

    @imath

    Well actually, in single.php i only thought about the comments feed. If you have post_meta where you store custom feeds for different posts, i have no better solution than yours.

    Avatar of Nm
    nm
    Participant

    @nahummadrid

    thanks. I wonder if anyone sees this, can recommend on how to get that to work! because it doesn’t! haha. how to make that $feedurl so ‘http://site.com/feed’ url is picked up by that the_bpmh_rss_button line. I missing something minor i know.

    Avatar of imath
    imath
    Moderator

    @imath

    You should try without putting $feedurl between quotes and add `true` as 3rd argument to get_post_meta otherwise you’re having an array.

    Just tested this :
    `<?php if(get_post_meta($post->ID, ‘post_custom_feed’,true)):?>
    <div>
    <?php if(function_exists(‘the_bpmh_rss_button’)) the_bpmh_rss_button(‘my custom feed’, get_post_meta($post->ID, ‘post_custom_feed’,true));?>
    </div>
    <?php endif;?>`

    and it’s working.

    Avatar of Nm
    nm
    Participant

    @nahummadrid

    thanks! i’m actively learning.

    Avatar of Nm
    nm
    Participant

    @nahummadrid

    that certainly does work. thanks! only thing now is the ‘my custom feed’ gets saved literally as the title for each feed. Any way for that to be the title of the post or the actual title of the feed. my dreams are coming true by the way.

    Avatar of imath
    imath
    Moderator

    @imath

    maybe you can replace ‘my custom feed’ by `get_the_title($post->ID)`…

    http://codex.wordpress.org/Function_Reference/get_the_title

Viewing 6 replies - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.