• I’ve stumbled across a bit of a glitch I think… and not really sure how to troubleshoot.

    I have disabled all the “Custom post types and Taxonomies” options, and disabled all the “Synchronization” options.

    I have a custom post type called “Events”… which Polylang is not enabled for (as I don’t want to offer translations for Events at this stage).

    I then posted a new Event, as normal. The post was added… but it will not show up in our Events archive page. I can view the event directly, but just can’t see it in the list of Events on our Events page.

    As soon as I disable Polylang, it shows up correctly.

    I re-enabled Polylang (and the event disappeared from our Events page again), went into “Custom post types and Taxonomies” and ticked “Events”, then pressed Save Changes. I then un-ticked it again and pressed “Save Changes” a second time, and this seems to have fixed the issue.

    So for some reason, I needed to toggle on/off the Custom Post Types setting for it to fix this issue. Is this something to do with me turning off all the “Synchronization” settings?

    Thanks!
    Kim

    https://ww.wp.xz.cn/plugins/polylang/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Support Chrystl

    (@chrystl)

    Hi

    Could you provide some screenshots to describe your issue by specifying if the Custom Post types module is activated or not.

    EDIT: Please could you provide a screenshot of Events pages list table when the Custom Post types module is activated.

    You can upload them via http://snag.gy and link to them here.
    Please don’t the admin top bar and the left menu on your screenshots. And don’t the Url adress for the screenshots on the front side.

    Thread Starter km

    (@kmaisch)

    Hi Chrysti,

    It’s working at the moment… (however have had a few other glitches, like our Posts page stopped displaying any content). To fix it I just went into the Polylang settings and hit “Save” on each of the pages.

    What does the “Synchronization” settings actually do? Should I turn some of these back on?

    Thanks!

    Plugin Support Chrystl

    (@chrystl)

    Whether the synchronizations are activated or not Polylang always copies all metadatas from the source post when creating a new translation.

    Once a synchronization option is checked, a modification to a post or page impacts all its translations.
    Example with a translated taxonomy: If you choose to add the category ‘Category FR’ to a French post, Polylang will automatically add its translation ‘Category EN’ to the translated English post. It’s the same behavior if you decide to remove a category.

    Do not check the Synchronization settings if you don’t know which result you expect.

    Thread Starter km

    (@kmaisch)

    Hmm we are having the same issue again. When we post a new post from our “Events” post type, it doesn’t show up on our posts page – even though it is definitely published.

    Here are our settings with all the post-types turned off: http://snag.gy/K4LB9.jpg

    I’ve just turned on the “Events” post type, and here is the screenshot of the Events pages listed: http://snag.gy/FVgdr.jpg

    It looks like the default language is not being set for the new posts that are created?

    I went in and edit the posts without the English language set – and now they show up.

    I thought if the “Events” post type is disabled in the first screen then it would assume english as the default language?

    Plugin Support Chrystl

    (@chrystl)

    I thought if the “Events” post type is disabled in the first screen then it would assume english as the default language?

    If you keep uncheck it in the CPT and Taxonomies module, the new CPT won’t have any language.
    But your CPT will be displayed in the front side in the default language, and you won’t have the language code in the URL.

    Some events plugin are not compatible with Polylang. Which Events plugin do you use?

    Thread Starter km

    (@kmaisch)

    It’s just a custom post-type, not a plugin… with the following settings:

    register_post_type(‘event’, array(
    ‘labels’ => array(
    ‘menu_name’ => _x(‘Events’, ‘admin menu’),
    ‘all_items’ => __(‘All Events’),
    ‘name’ => _x(‘Events’, ‘post type general name’),
    ‘add_new’ => _x(‘New Event’, ‘event’),
    ‘add_new_item’ => __( ‘Add New Event’)
    ),
    ‘public’ => true,
    ‘show_ui’ => true,
    ‘capability_type’ => ‘post’,
    ‘hierarchical’ => false,
    ‘rewrite’ => true,
    ‘query_var’ => true,
    ‘menu_icon’ => ‘dashicons-calendar-alt’,
    ‘supports’ => array(‘title’, ‘editor’, ‘custom-fields’, ‘thumbnail’, ‘page-attributes’)

    Thread Starter km

    (@kmaisch)

    Could it be because we are trying to display the Events archive in a loop on a page?

    That page has the language set to “English” – does that mean any loops on that page (pulling custom post types) it will only display posts that have the language set as English too?

    Thread Starter km

    (@kmaisch)

    Here’s the query that we use to display the news/events:

    function index_filter($query) {
    	if(!is_admin() && $query->is_main_query()){
    		if($query->is_posts_page){
    			if($_GET['show'] == 'events'){				$query->set('post_type', array('event'));				$query->set('orderby', 'meta_value_num');				$query->set('meta_key', '_ei_start_date');				$query->set('order', 'ASC');			}
    			elseif($_GET['show'] == 'news'){				$query->set('post_type', array('post'));			}
    			else{				$query->set('post_type', array('post', 'event'));			}
    		}
    		elseif($query->is_search){
    			$query->set('post_type', array('event', 'post', 'downloads', 'page'));
    		}
    	}
    }
    add_action('pre_get_posts','index_filter');
    Plugin Support Chrystl

    (@chrystl)

    Does it works if you add in register_post_type : 'has_archive' => true, ?

    Thread Starter km

    (@kmaisch)

    We’re not really wanting to use an archive page for ‘Events’… as we’re displaying Posts (normal posts) and Events (custom post type) on the one page – basically just on index.php with pre_get_posts modified to include both events & posts.

    I suppose the easiest fix is just to turn on Translations for “Events” and leave it at that.

    Strange that we don’t get the same problem for normal posts, only the custom post type though….

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

The topic ‘Custom post type – not showing up when Polylang enabled’ is closed to new replies.