[Support request] Date above title in specific list

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Date above title in specific list

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #26849
    William
    Participant

    Hi,
    I figure out how to move the date above title using this

    add_action( 'after_setup_theme','date_above_title' );
    function date_above_title() {
        remove_action( 'wpsp_after_title','wpsp_add_post_meta_after_title' );
        add_action( 'wpsp_before_header','wpsp_add_post_meta_after_title' );
    }

    but is there a way to only have date above title to show on specific wp show posts list and not all.

    #26936
    Tom
    Keymaster

    Unfortunately there is no way to tell within the actual hooks.

    You can target specific pages for the code to execute on, though:

    add_action( 'wp', function() {
        if ( is_page( 'My Page' ) ) {
            remove_action( 'wpsp_after_title','wpsp_add_post_meta_after_title' );
            add_action( 'wpsp_before_header','wpsp_add_post_meta_after_title' );
        }
    } );
    #26962
    William
    Participant

    Thanks for the tip. Is it possible to have it target specific list on a page if I have multiple lists?

    #27058
    Tom
    Keymaster

    Unfortunately not at this time – we don’t have access to the list data when using add_action() and remove_action().

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.