We're merging with GenerateBlocks! Learn more here.

[Resolved] Excerpt as title

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Excerpt as title

Viewing 9 posts - 16 through 24 (of 24 total)
  • Author
    Posts
  • #16940
    Tom
    Keymaster

    In this case, it would be wpsp_after_content.

    #16945
    Bernhard
    Participant

    ok, thank you.

    #16967
    Tom
    Keymaster

    No problem 🙂

    #32590
    Bernhard
    Participant

    Hi Tom,
    I have now the following code repeated for every involved post/page id:

    add_action( 'wpsp_after_content', function( $settings ) {
        $custom_field = get_post_meta( get_the_ID(), 'wpsp_title2', true );
    
        if ( $custom_field && 123 === $settings['list_id'] ) {
            echo '<h2>';
                echo $custom_field;
            echo '</h2>';
        }
    } );

    Is it possible to put all the Id’s in a unique array like ( 123, 124, 125 ) ?

    #32633
    elvin
    Moderator

    Hi there,

    Not exactly sure what you mean w/ the array IDs, is it for the posts or are you trying to apply this on multiple WPSP list ids?

    Let us know. 😀

    #32644
    Bernhard
    Participant

    HI Elvin,
    I mean list IDs.

    #32646
    elvin
    Moderator

    You can try playing around with PHP’s in_array().

    Example:

    $list_id = array('123', '456', '789' );
    
    if ( $custom_field && in_array( $settings['list_id'], $list_id) )
    #32665
    Bernhard
    Participant

    Perfect, thank you 🙂

    #32668
    elvin
    Moderator

    No problem. 😀

Viewing 9 posts - 16 through 24 (of 24 total)
  • You must be logged in to reply to this topic.