• I am working on a site built by a developer that features custom template pages for every page. I want to add a blog page to the site. Using the normal steps (static home with blog page) gives me this: [ redundant link removed ] despite having added posts to the backend. When I click on the view post links I get the same page (header and footer but no content). None of the content I put into the block editor shows up on the posts. If I unassign my “blog” page from being the blog page, it just shows as a completely white page on the front end.

    Is it possible to code a template page that I can set my blog page to in order to correct this? And how would I do that!

    TIA!

    • This topic was modified 2 years, 3 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @penandq6, I can try to help with your issue. If I understand correctly, you have a custom template created for every page, and you’d like to use one of these templates to be able to display an archive page to list your posts, right?

    Generally, archive templates are written differently than post or page templates, and depending on how the developer writes the templates; they may not support archive pages. The templates should utilize what’s referred to as The Loop, which adds logic to the page to output all the posts that match a page. See the page I linked to for information about how that works, but my guess is that logic needs to be added to the templates for it to work.

    Otherwise, it appears you configured your site correctly to use the custom template for the archive. If I go to https://www.sequenex.com/category/articles/, it acts the same way as /blog/, so once you figure out what to add to the template, it should start working.

    FWIW, the Developing with WordPress forum may be more appropriate for this question, as it doesn’t necessarily have to do with something broken in core WordPress. However, I see this question was moved from there, so perhaps somebody on that forum thought otherwise.

    Thread Starter penandq6

    (@penandq6)

    @bengreeley would the loop functionality need to be added to all page templates in order to create a functional blog page?

    Do you think this is the problem that’s causing the posts to not display correctly as well?

    @penandq6 Yes, they are very likely related to the loop functionality missing from the template. When I browse to one of your posts such as https://www.sequenex.com/?p=218 I get the same page that isn’t outputting the content.

    I’d start with a single page template, and when you get that working copy/paste to the other templates. There are some examples on the WordPress page about loops I linked to or you could try copy/pasting the example code on the bottom of the page at https://www.wpbeginner.com/glossary/loop/ into your template.

    It’s a bit technical if you’re not used to modifying templates but I’m crossing my fingers that you’re able to get it working by following these examples.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Adding Blog Page to Site with Custom Page Templates’ is closed to new replies.