• Resolved jurj3n

    (@jurj3n)


    What would i need to add when I would like to use Aged Content Message only on a specific custom post type, eg ‘performance’.

    Would I need to use this as a base (from your FAQ)?

    /* Set condition for displaying message to include pages. */
    function yourprefix_aged_content_message__the_content_condition() {
        return ! is_single() && ! is_page();
    }
    add_action( 'aged_content_message__the_content_condition',
        'yourprefix_aged_content_message__the_content_condition' );

    I would use it only on the custom post type.

    https://ww.wp.xz.cn/plugins/aged-content-message/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Anonymous User 7658014

    (@anonymized_7658014)

    Yes, that snippet can serve as a base. If you want the message appearing only on singular views of a given post type, this should do (untested though):

    function aged_content_message__the_content_condition__only_post_type() {
    	return ! is_singular( 'your_post_type_slug_here' );
    }
    add_filter( 'aged_content_message__the_content_condition', 'aged_content_message__the_content_condition__only_post_type' );

    (Function reference)

    Anonymous User 7658014

    (@anonymized_7658014)

    User can’t be bothered to post any feedback, but apparently the solution worked at least as a boilerplate for their specific use case.

    Thread Starter jurj3n

    (@jurj3n)

    Uhm, reads a bit harsh Caspar.. Very happy with your help, thank you very much.

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

The topic ‘Using on custom post type only’ is closed to new replies.