Support » Plugin: WP Auto Republish » Include custom post types

  • Resolved silentsooty

    (@silentsooty)


    Hello
    On my website https://www.attractionsnearme.co.uk/ I can get your application to republish regular posts with no issues. I use the WP GeoDirectory plugin which creates custom post types which I would like to auto-republish. Each new listing I make with GeoDirectory is a custom post. By default, GeoDirectory offers a single custom post type, called “Places”.
    You can see an example of a post created using GeoDirectory here:
    https://www.attractionsnearme.co.uk/places/themeparks/alton-towers/
    I have followed your instructions to add the recommended snippet of code to my Sydney Child Theme functions.php but it is not picking up my WP GEODirectory Places. Any guidance you can give me would be much appreciated.
    Many Thanks, Dan
    Attractions Near Me

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Sayan Datta

    (@infosatech)

    Hi @silentsooty

    Could you please paste the snippet here which you are using?

    Thanks!

    Hello

    Please find the snippet below:

    /* Allows me to Republish Custom Posts ie GEODirectory Places using WP Auto Republish */
    add_filter( ‘wpar_supported_post_types’, ‘wpar_add_custom_post_types’ );

    function wpar_add_custom_post_types( $output ) {
    $post_types = array( ‘page’, ‘product’, ‘any_cpt’ );
    return array_merge( $output, $post_types );
    }

    Regards
    Dan

    Plugin Author Sayan Datta

    (@infosatech)

    Hi @silentsooty

    You need to add your post type slug to this snippet:

    Replace your current code with this:

    add_filter( 'wpar_supported_post_types', 'wpar_add_custom_post_types' );
    
    function wpar_add_custom_post_types( $output ) {
        $post_types = array( 'gd_place' );
        return array_merge( $output, $post_types );
    }

    Thanks!

    Hi Sayan

    That worked perfectly, many thanks for your excellent support. I will be leaving a 5-star rating.

    Regards
    Dan https://www.attractionsnearme.co.uk/

    • This reply was modified 8 months, 3 weeks ago by  silentsooty. Reason: Marked as resolved
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Include custom post types’ is closed to new replies.