• sahumphreys

    (@sahumphreys)


    Hi

    New to WordPress … (hosting locally right now)

    I’ve created a few pages having customised the Twenty Twenty Two theme, added a menu to link these pages but on going to those pages from the menu the page content is not being displayed. I can view and edit the pages from the Dashboard and content is there, but when viewing the site it’s blank aside from the template components.

    Each of the pages thus far is static content (not posts), there are not activated plugins (I saw that might be a problem from other forum posts). All are set to public and visible.

    Do I need to assign some kind of placeholder in the template to display the content?
    I expect I’m missing something really obvious

Viewing 3 replies - 1 through 3 (of 3 total)
  • fozlarabbi

    (@fozlarabbi)

    Hi @sahumphreys ,

    It’s quite hard to say about the issue if you have customized the core files of the twenty twenty two theme. Do you see the contents of the pages if you change the theme to twenty twenty one for example? ??

    You can change the theme from WordPress Dashboard > Appearance > Themes option.

    Thanks

    • This reply was modified 2 years ago by fozlarabbi.

    Do I need to assign some kind of placeholder in the template to display the content?

    I’m guessing here, but my suspicion is that a theme block might have gotten deleted in the template that shows the content you’ll write in your dashboard under “Pages”.

    If you head to your site editor (appearance > Editor > upper-left-hand icon > templates) and open the template you’re working on, click on the list view and expand each section. Do you see a theme block called “post title” or “post content”?

    Here’s a gif to show you what I mean.

    Even though these are pages, you’ll need content blocks that show “post title” and “post content”. A page is technically a type of post (if I understand it correctly anyway), so if those blocks got removed from the template, that may be why your pages appear blank, even though you’re writing content in “Pages”.

    What might fix it:
    To add them back, use the inserter (the plus sign in the top left-hand corner) and look for the theme blocks, “post title” and “post content”. Add them to your template, save, and see if your page content shows.

    If that doesn’t help, consider taking a screenshot of what the template looks like in the site editor and sharing that here with us — that may help us help you figure out the issue. ??

    There could be several reasons why the content is not showing in the template page . Some common issues include:

    1. Incorrect template file name or path: Make sure the template file name and path are correct in the code.
    2. Missing data: Make sure that the data being passed to the template is not empty or missing.
    3. Syntax errors: Check for any syntax errors in the code, such as missing tags or incorrect indentation.
    4. Template engine error: Check for any errors in the template engine configuration or initialization.
    5. Permission problem: Make sure the file and folder have the correct permission.
    6. Cache problem: Check if the browser or server cache is not refreshing the page.

    It’s hard to say exactly what the problem is without more information about the specific implementation.

    • This reply was modified 1 year, 10 months ago by sondaurte7.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Page content not showing in template page’ is closed to new replies.