Viewing 4 replies - 1 through 4 (of 4 total)
  • I wouldn’t mind having this myself. Thx

    Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    you can modify the last code to something like this

    
    add_action("wp", "show_expired_ads_hide_contact", 1000);
    function show_expired_ads_hide_contact() {
        global $post_id;
    
        if( is_singular( 'advert' ) ) {
            $advert = get_post( $post_id );
            if( $advert->post_status == "expired" ) {
                remove_all_actions( "adverts_tpl_single_bottom" );
                add_action( "adverts_tpl_single_top", "show_expired_notification", 5 );
            }
        }
    }
    function show_expired_notification( $post_id ) {
        echo "<strong>THIS AD IS EXPIRED</strong>";
    }
    

    Then below the Ad title you should see the expiration notification message.

    Thread Starter Webbureau.dk

    (@twolle)

    It works – thanks ??

    Is it possible to make it a <h2>…</h2>.

    I tried to insert it before/after but it didn’t work.

    Plugin Author Greg Winiarski

    (@gwin)

    You should be able to use any HTML tag, unless it is somehow filtered by some other function, in this case you might need to use <strong> tag with ‘style’ param.

    
    <strong style="font-size:20px">THIS AD IS EXPIRED</strong>
    
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Expired ads marked with “Expired”’ is closed to new replies.