• Resolved Farhan Farrukh

    (@farhanfarrukh)


    Hi
    I’m having an issue with my custom post type. I have a custom post type having parent child relationship. I’m using the following code to bring back all the posts for explanatory-material:

    wp_list_pages('title_li=&echo=0&sort_order=ASC&post_type=explanatory-material');

    This works fine as long as I’m logged in and an Administrator. But as soon as I log out wp_list_pages returns an empty string.

    This is how I’m registering my custom post type:

    register_post_type('explanatory-material', array(
        'labels' => array(
          'name' => 'Explanatory Materials',
          'singular_name' => 'Explanatory Material',
          'add_new' => 'Add new Explanatory Material',
          'add_new_item' => 'Add new Explanatory Material',
          'edit_item' => 'Edit Explanatory Material',
          'view_item' => 'View Explanatory Material'
        ),
        'public' => true,
        'menu_position' => 11,
        'menu_icon' => 'dashicons-media-document',
        'supports' => array('title', 'author', 'editor', 'revisions', 'excerpts', 'thumbnail','custom-fields', 'page-attributes'),
        'show_ui' => true,
        'hierarchical' => true,
        'rewrite' => array('slug' => 'explanatory-material/item', 'with_front' => false),
      ));

    If I turn of memberhship plugin it starts to work fine but for some reason it is blocking explanatory material (my custom post type) using wp_list_pages.

    Any help will be much appreciated

    https://www.ads-software.com/plugins/membership/

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Bojan Radonic – WPMU DEV Support

    (@wpmudev-support4)

    Hey there Farhan Farrukh,

    How are you doing today?

    Are you by any chance using Category Protection add on? If yes please try deactivating the add-on and see if it changes anything.

    The reason I ask is because there is a bug with that specific add on which is preventing custom post type posts to be displayed properly.

    Best regards,
    Bojan

    Thread Starter Farhan Farrukh

    (@farhanfarrukh)

    Hi Bojan

    Thank you very much for coming back. I’m not using the Category Protection Add on. The Addons I’m using are

    Member Capabilities
    Protect Special Pages
    Redirect Control
    URL Protection

    I’m also on the latest version of Plugin

    Plugin Author Bojan Radonic – WPMU DEV Support

    (@wpmudev-support4)

    Hey again Farhan Farrukh,

    Can you please add more information about the protection rules you’re using with Protect Special Pages and URL Protection.

    Also can you please post link to your site so I can see this in action.

    Best regards,
    bojan

    Thread Starter Farhan Farrukh

    (@farhanfarrukh)

    Hi,

    Please find the the link below to the page where I’m trying to get a list of posts:

    Explanatory Materials

    You will not be able to see the lists but once logged in as admin I can see the list or if I disable the plugin I get the right behaviour.

    Before you ask I have removed all add-on and still can’t see the list publically. I have also tested it by disabling all plugins but still it only shows when you are logged in as Admin.

    I’m just calling

    wp_list_pages('title_li=&echo=0&sort_order=ASC&post_type=explanatory-material');

    To get all posts from my custom post type

    Plugin Author Bojan Radonic – WPMU DEV Support

    (@wpmudev-support4)

    Hey again Farhan Farrukh,

    Thanks for the additional info. This is actually related to a page rules and the filter that is being used there.

    I’ve notified our plugin developer about this and we’ll include a fix for this in the following Membership 2 update.

    Thank you for reporting this ??

    Best regards,
    Bojan

    Thread Starter Farhan Farrukh

    (@farhanfarrukh)

    Thank you very much

    Any Idea when this will be fixed and available? Or is it possible for you provide me with a temporary patch which I can use so that my client can go live with it.

    Thank you very much once again for you help.

    Regards,
    Farhan

    Plugin Author Bojan Radonic – WPMU DEV Support

    (@wpmudev-support4)

    Hey again Farhan Farrukh,

    I’ve checked with our developer regarding the update and we’ll have the update pretty soon with some other fixes as well.

    I’d strongly suggest waiting for the update rather then making changes on your own. Also if the update release is prolonged I’ll ask for the code so you can fix that manually.

    Best regards,
    Bojan

    Thread Starter Farhan Farrukh

    (@farhanfarrukh)

    Thank you very much Bojan
    Much Appreciated

    Plugin Author Bojan Radonic – WPMU DEV Support

    (@wpmudev-support4)

    Glad I could help ??

    Cheers,
    Bojan

    Thread Starter Farhan Farrukh

    (@farhanfarrukh)

    Hi Bojan

    My Client has asked us to do a deployment on Friday. If the fix is not going to be available by firday can I request you to please ask for the code so that I can fix it manually and once the update is available I will replace it with the latest version of the plugin.

    If you can send me the code to the following email I will be really thankful to you [email protected]

    Regards,
    Farhan

    Plugin Author Bojan Radonic – WPMU DEV Support

    (@wpmudev-support4)

    Hey again Farhan,

    Generally we’re not allowed to contact members outside of forum and you should not post your email address here, you can find more info here.

    Considering the situation and the deadline you’ve got, I’ve sent you email with the file attached that needs to be replaced.

    Best regards,
    Bojan

    Thread Starter Farhan Farrukh

    (@farhanfarrukh)

    Bojan you are a life saver Thank you very much. I have applied the fixed and it is working like a charm now.

    Sorry I wasn’t aware that I was not allowed to post emails here but thank you so much for considering my deadline and making efforts to send me the fix.

    You guys rock awesome support

    Thank you

    Regards,
    Farhan

    Plugin Author Bojan Radonic – WPMU DEV Support

    (@wpmudev-support4)

    Hey Farhan,

    Glad I could help and that the fix is working for you ??

    Have a nice weekend!

    Cheers,
    Bojan

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Having issue with wp_list_pages’ is closed to new replies.