• Resolved bandit99

    (@bandit99)


    Great Plugin, but I have a problem with inserting some pages…

    Some pages insert fine, others don’t display the content. For example, if I use display=’all’, I can see:

    Page Title

      total_sales: 0
      toggle_page_title: 0
      site-sidebar-layout: default
      site-content-layout: default
      theme-transparent-header-meta: default`

    But there is no content.

    This is with version 3.7.4. I’ve tried changing settings to Legacy or Normal as per another post, but no change.

    Help appreciated! Thanks

    • This topic was modified 2 years, 3 months ago by bandit99.
Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Paul Ryan

    (@figureone)

    Are you using another “page builder” plugin to generate content? It’s possible that it doesn’t store it in wp_posts.post_content, which is where WordPress normally puts it.

    Thread Starter bandit99

    (@bandit99)

    No.

    The page (that I am trying to insert) is built with the standard WP page editor. I have a source ‘template’ page from which text is copied (within WP editor) & pasted into a newly created page. The new page is then edited slightly, and it’s that page that I am trying to insert into a third page.

    That’s the way I generally create pages, and some pages created that way show correctly when inserted via your Insert Pages plugin and some pages just fail to show…

    I just cannot track down the reason or what is different between those that work & those that don’t ??

    Plugin Author Paul Ryan

    (@figureone)

    Strange. Are they all published pages? Draft or Private pages require elevated permissions to see them, even when inserted. Have you verified in the database that the content for those page IDs exists in wp_posts.post_content?

    Thread Starter bandit99

    (@bandit99)

    Generally speaking, the pages (both main & inserted) are Private when I’m creating/editing. I’m logged in as Admin, so everything should be good. I can view both pages without a problem – just not the inserted page when viewing the main page ??

    I have previously tried changing the ‘main page’ & ‘inserted page’ to Public visibility and recreating the insert code, but the result is the same.

    Yes, there are entries in wp_posts.post_content (for both the page and the product – it’s a WooCommerce site).

    Strangely, some (probably most) pages insert without a problem. I’ve only just started using the plugin & the first page I created & tried to insert didn’t show. I tried a few previously created pages, and they worked fine. I created a new page and replicated settings from the page that didn’t show & copied/pasted the page content (WP editor) – I could insert that page without a problem. However, the very next page I created wouldn’t show.

    Plugin Author Paul Ryan

    (@figureone)

    Yeah that’s weird. It sounds like maybe a conflict with your theme or another plugin. Can you try reproducing on a vanilla WordPress site? Or try a different theme, and disable other plugins one by one and see if things change.

    Can you also look at the actual page markup (html) and see if the <div data-post-id="123" class="insert-page insert-page-123">...</div> element is output and contains anything. Perhaps things are just being hidden by CSS.

    Thread Starter bandit99

    (@bandit99)

    Thanks Paul. I’ll try to reproduce on a backup staging site & then see if I can start disabling things etc.

    Also, I’ll check the page HTML & check what’s there… instead of what we can see.

    Thread Starter bandit99

    (@bandit99)

    OK, I think I’ve made progress on this bug…

    In my particular setup (& it’s a site with many plugins etc.) I can at least reproduce the problem.

    Create a Page in WP – we’ll call it ‘Daughter Page’ – It has a page URL of domain/daughter-page
    (I’m making the visibility private because I’m testing on a live site, but I don’t think it matters if Private or Public)
    Create a Product in WooCommerce – we’ll also call it ‘Daughter Page’ – It has a permalink of domain/product/daughter-page
    (I’m setting catalog visibility to Hidden again because it’s a live site. But I don’t think visibility matters)
    Create a ‘Mother page’ (call it Mother Page, URL domain/mother-page)) and include an Insert Pages code [insert page=’daughter-page’ display-‘content’]
    (I set visibility to Private, but again I don’t think this matters)

    View (with admin rights because the pages are private) domain/mother-page – the Daughter Page doesn’t show…

    Edit the product permalink of product ‘Daughter Page’ to domain/daughter-page-2

    View again domain/mother-page – the Daughter Page now shows.

    So, the error/bug seems to be caused by having a WP Page & WC Product of the same name.

    OK, it seems easy to say make sure the names are different, but we have thousands of products with Page & Product named the same & life would get very confusing if we started naming the pages/products differently!

    Hopefully, the above explains how I can at least reproduce the problem and helps track down the cause!

    Thanks

    • This reply was modified 2 years, 3 months ago by bandit99.
    Plugin Author Paul Ryan

    (@figureone)

    Nicely done tracking that down. Insert Pages uses get_page_by_path() so that must struggle when there is collision with the slugs.

    The best workaround is to switch to using Page IDs instead of slugs in your Insert Pages shortcodes. IDs are always unique even for different post types. You can see the ID in the URL when editing it, e.g., https://example.com/wp-admin/post.php?post=2&action=edit is editing the page with ID 2.

    In wp-admin > Settings > Insert Pages, you can switch the Shortcode format to use page IDs; this will switch to using IDs for any new shortcodes you insert. (But you’ll still need to manually change the ones you have already created.)

    Thread Starter bandit99

    (@bandit99)

    Yep, that’s nailed it!

    Thanks very much; at least that’s a workaround. Not quite as convenient as using Page Title, but certainly acceptable.

    Perhaps in a future update, there might be the possibility of using Page Title.

    Plugin Author Paul Ryan

    (@figureone)

    Great!

    Using Page Title would be tough since WordPress doesn’t enforce any uniqueness there. Page IDs are guaranteed unique, and slugs are unique within a post type at least.

    Thread Starter bandit99

    (@bandit99)

    OK, thanks for your help and problem resolution.

    rbteller

    (@rbteller)

    I am using Enfold (a very popular WordPress theme) which uses the LayerSlider WP plugin from Kreatura to build full-width layersliders. When I attempt to share the content of a page (using Insert Pages) containing a layerslider, the page renders correctly except for the layerslider which is empty.

    I believe the problem is that the content for the layerslider is stored in wp_layerslider.data not in wp_posts.post_content

    How can I get Kreatura layersliders to render correctly in Insert Pages…??

    Plugin Author Paul Ryan

    (@figureone)

    Since Enfold is not an open source theme we can’t access the code to build an integration.

    If Enfold has public documentation on how their theme template renders the layerslider we can try to use that; otherwise we would need developer access to the theme code to discover what functions to call and how to detect whether Enfold is installed.

    I’d suggest reaching out to them and see what their preference is.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Blank Page Content’ is closed to new replies.