WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Sudden loss of blog page (7 posts)

  1. jayce103
    Member
    Posted 4 years ago #

    Hi all,

    I have my blog posts visible on a blog page, while all other posts go onto seperate page. All was working well untill suddenly my blog page is just blank.

    http://www.jayceclarkephotography.co.uk is the url anyone any ideas?

    I have looked to see if the template page is still linked and it is, and not changed.

    The only changes that I have done are.

    1) Placed all posts onto new page and have the home page set to static.
    2) Placed another page link in nav bar

    Cheers,

    Jayce

  2. buddha trance
    Member
    Posted 4 years ago #

    Try updating your permalinks.
    Admin dashboards --> Settings --> Permalinks
    and simply "Save changes"

    see if this solves the issue.

  3. jessn
    Member
    Posted 4 years ago #

    Did you set the /myblog/ page as the "Posts" page in the Settings->Reading area?

    It's weird but that entire page is just blank. You said you were using a template for the page? Try turning off the template temporarily to see if you can get at least something to show up on that page, like the header.

    Nice website by the way!!

  4. jayce103
    Member
    Posted 4 years ago #

    Hi buddha,

    Tried that nothing.

    Hi jessn, and thanks, hopefully will be finished if I stop tweaking.

    Tried that and nothing, however I put the post to page as myblog and my post showed (not the blog posts tho), I have now reset this and the posts are back on the clients page where they should be (again not the myblog posts.

    I would expect that because I have changed where the posts reside (IE not on the generic homepage), I need to update the myblog template page but thats just a guess.....

  5. jayce103
    Member
    Posted 4 years ago #

    **update**

    If I choose the defauly template it does show a default page so must be something to do with the template file

    CODE USED BELOW:::

    <?php
    /*
    Template Name: Myblog
    */
    global $more;
    ?>
    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $args= array(
    'category_name' => 'blog',
    'paged' => $paged
    );
    query_posts($args);
    ?>
    <?php get_header(); ?>

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    <div class="post" id="post-<?php the_ID(); ?>">

    <h2><?php the_title(); ?></h2>

    <?php $more = 0;the_content('<p class="serif">Read the rest of this page »</p>'); ?>

    <?php wp_link_pages(array('before' => '<p>Pages: ', 'after' => '</p>', 'next_or_number' => 'number')); ?>

    </div>

    <?php endwhile; endif; ?>
    <?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>
    <?php include (TEMPLATEPATH . "/bottom.php"); ?>
    <?php get_footer(); ?>

  6. jessn
    Member
    Posted 4 years ago #

    Ok I see...looks like you're doing something similar to a blog I set up recently. Try this code:

    <?php
    /*
    Template Name: Myblog
    */
    ?>
    <?php get_header(); ?>
    <?php
    $temp = $wp_query;
    $wp_query= null;
    $wp_query = new WP_Query();
    $wp_query->query('showposts=10&category_name=blog'.'&paged='.$paged);
    ?>
    <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
    
    <div class="post" id="post-<?php the_ID(); ?>">
    <h2><?php the_title(); ?></h2>
    <?php $more = 0;the_content('<p class="serif">Read the rest of this page ยป</p>'); ?>
    <?php wp_link_pages(array('before' => '<p>Pages: ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
    </div>
    
    <?php endwhile; ?>
    <?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>
    <?php include (TEMPLATEPATH . "/bottom.php"); ?>
    <?php get_footer(); ?>

    That code works great for me. I'm guessing the "global $more;" that you have in your template name is what's screwing up the page.

  7. jayce103
    Member
    Posted 4 years ago #

    Hi jessn,

    Don't know what you did but it worked a treat!!!!

    Thanks to you both for helping out.

    Jayce

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.