Forums

Manual Related Posts
Using Custom Field Instead of excerpt below title of related post (4 posts)

  1. amaykul
    Member
    Posted 4 months ago #

    I am trying to use the output from a custom field instead of the excerpt.

    I have managed to get the custom field showing below the title of the related posts. But the problem is the custom field takes the post ID of the current post instead of the related post.

    This is what I did, edited baw-manual-related-posts/inc/frontend-noajax.inc.php

    Replaced:
    case 'excerpt': $p = get_post( $id ); $_content = '<br />' . apply_filters( 'the_excerpt', $p->post_excerpt ) .'<p>&nbsp;</p>'; break;

    To:
    case 'excerpt': $p = get_post( $id ); $_content = '<br />' . get_custom_field_value('cp_base_pay', $p->post_excerpt ) .'<p>&nbsp;</p>'; break;

    I tried:
    case 'excerpt': $p = get_post( $id ); $_content = '<br />' . get_custom_field_value($postid, 'cp_base_pay', $p->post_excerpt ) .'<p>&nbsp;</p>'; break;

    But it doesn't seem to work.

    Someone please help.

    Thanks

    http://wordpress.org/extend/plugins/baw-manual-related-posts/

  2. amaykul
    Member
    Posted 4 months ago #

    would something like this work?

    case 'excerpt': $p = get_post( $id ); $_content = '<br />' . apply_filters( 'the_meta_key', 'CUSTOM_FIELD_NAME', $p->post_excerpt ) .'<p>&nbsp;</p>'; break;

  3. fab4_33
    Member
    Posted 2 months ago #

    hi,

    I'm trying to do the same, show a custom field below the thumb.

    I'm still trying !

    @amaykul
    Did you find a solution ?

  4. Jason Lemahieu (MadtownLems)
    Member
    Posted 1 month ago #

    You should be able to use the bawmrp_more_content filter to output what you want without hacking the plugin's code.

Reply

You must log in to post.

About this Plugin

About this Topic