Forum Replies Created

Viewing 15 replies - 1 through 15 (of 17 total)
  • Thread Starter murielleh

    (@murielleh)

    Thank you CrouchingBruin

    Thread Starter murielleh

    (@murielleh)

    OK it worked!! Once I created the new Blog page without template, designated it in Settings and replaced the index page with a new one from the parent theme, everything lined up perfectly.

    Thank you so much, Alchymyth!!! I have been trying to solve this for months ??

    Have a great night,
    Elle

    Thread Starter murielleh

    (@murielleh)

    OK great thank you I will try that.

    Meanwhile I added specific category ID’s to the index.php file in the child theme and it produced some results. It now shows the most recent post from each category but no others. See code here:

    <?php
    /* Set up an array to hold the ids for the categories we want to pull from
    * The order in which the posts are called & displayed is goverened by their
    * placement in this array
    */
    $my_cat_array = array(3,6,1,4);

    In any case, I’ll do what you said and that will fix it I’m sure.

    Thank you Alchymyth!!

    Thread Starter murielleh

    (@murielleh)

    Oh, and I deactivated all the plugins again, but it made no difference.
    Now I will try your other suggestions.

    Thread Starter murielleh

    (@murielleh)

    Hi there,

    Thank you for the suggestions. I will try them shortly.

    – The Blog page (which is designated in Settings>Reading as the Post page) is the one using the PageOfPosts template. I have tried it also with the Default Template and it makes no difference.

    – Here is the code for index.php in my child theme:

    <?php
    
    get_header(); ?>
    
    <div id="primary">
    <div id="content" role="main">
    
    <?php
    /* Set up an array to hold the ids for the categories we want to pull from
    * The order in which the posts are called & displayed is goverened by their
    * placement in this array
    */
    $my_cat_array = array(5,3,22,1);
    
    /*
    * Set up a flag that will indicate if we've returned ANY posts from any of the chosen categories
    * As we don't have access to the standard Loop 404, we'll need this in case we
    * bomb out on all categories. This kind of post counter can come in useful elsewhere...
    */
    $posts_count = 0;
    
    /*
    * Rather than modify the main Loop, we'll use get_posts to create 3 secondary loops that grab * the first post from each of these categories. This has the benefit of leaving the main Loop * untouched if you want to call it later on in the page.
    */
    foreach ( $my_cat_array as $my_cat) :
    
    // Set up the secondary loop query
    $args = array(
    	'numberposts' => 1, // number of posts to return
    	'cat' => $my_cat // the category id
    );
    $lastpost = get_posts($args);
    
    // If we have at least 1 post, increment the post_counts flag
    if( count( $lastpost ) > 0 ) $posts_count++;
    
    // We still have to run a foreach Loop - even if there's only 1 post.
    foreach($lastpost as $post) :
    
    /*
    * Call the internal function setup_postdata(), with the $post array as its argument
    * This is so that we can access all post data
    */
    setup_postdata($post);
    
    // Now we can display the post using all of the standard Loop tags
    ?>
    <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
    
    <div class="entry-content">
    <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?>
    <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyeleven' ), 'after' => '</div>' ) ); ?>
    </div><!-- .entry-content -->
    
    <div class="entry-utility">
    <?php if ( count( get_the_category() ) ) : ?>
    <span class="cat-links">
    <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', get_the_category_list( ', ' ) ); ?>
    </span>
    <span class="meta-sep">|</span>
    <?php endif; ?>
    <?php
    $tags_list = get_the_tag_list( '', ', ' );
    if ( $tags_list ):
    ?>
    <span class="tag-links">
    <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?>
    </span>
    <span class="meta-sep">|</span>
    <?php endif; ?>
    <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyeleven' ), __( '1 Comment', 'twentyeleven' ), __( '% Comments', 'twentyeleven' ) ); ?></span>
    <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
    </div><!-- .entry-utility -->
    </div><!-- #post-## -->
    
    <?php endforeach;
    // Move onto the next post in the category array
    
    // We've finished!
    endforeach;
    
    // We now need to check that we did manage to display at least 1 post
    if ( $posts_count == 0 ) :
    // Uh oh - we didn't display any posts! ?>
    <div id="post-0" class="post error404 not-found">
    <h1 class="entry-title"><?php _e( 'Not Found', 'twentyeleven' ); ?></h1>
    <div class="entry-content">
    <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p>
    <?php get_search_form(); ?>
    </div><!-- .entry-content -->
    </div><!-- #post-0 -->
    <?php endif;?>
    
    </div><!-- #content -->
    </div><!-- #primary -->
    
    <?php get_sidebar(); ?>
    <?php get_footer();

    – the following files are in the child theme:
    functions.php, header.php, index.php, page.php, pageofposts.php, style.css and screenshot.png

    Thanks!!!!

    Thread Starter murielleh

    (@murielleh)

    The test site is at
    https://muriellehamilton.com/jamietest/

    In the test site, another blog shows up after the first, but it’s the only one that does that. I can’t get the other ones to show up.

    One more thing: when I change the date on one of the blogs to make it more recent than the top one, then the newest one shows up and takes the place of the one I had before.

    So it seems to be a line of code somewhere that says: post only the most recent post in each category? But where?

    Thread Starter murielleh

    (@murielleh)

    OK now I have my testsite uploaded at

    https://muriellehamilton.com/jamietest

    and the blog page is still showing one post only. Alchymyth, if you get a chance to look at it and can derive more info, it would be much appreciated as I’d love to resolve this issue.

    Thanks!
    M

    Thread Starter murielleh

    (@murielleh)

    I thought I had posted the following already – reposting just in case and my apology if redundant:

    I had meanwhile solved the problem by opening the file from browser with URL:
    localhost:8888/installer.php

    after I had moved the installer to the root folder together with the zipped package, and talked to the host tech support (inmotion) who enabled my IP to go through their sql firewall.

    The test site is up now at
    muriellehamilton.com/jamietest

    Thanks so much for your prompt response and your help!

    Thread Starter murielleh

    (@murielleh)

    in the Debug log, I get those two errors repeatedly:

    [23-Feb-2014 23:38:17 UTC] PHP Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method EasyColumns::uninstall() should not be called statically in /Applications/MAMP/htdocs/holistichealingwithjamie/wp-includes/plugin.php on line 429
    [23-Feb-2014 23:38:17 UTC] PHP Fatal error: Using $this when not in object context in /Applications/MAMP/htdocs/holistichealingwithjamie/wp-content/plugins/easy-columns/easy-columns.php on line 459

    I had tried several days ago to delete the plug in “Easy Colums” from inside WordPress, and it kept giving me an error message and would not delete, so I took it out of the plugin folder in Finder (Mac), but it still gives me the error messages in the debug log.

    Would that have anything to do with my little problem?

    Thread Starter murielleh

    (@murielleh)

    You asked: does each of the categories have at least one published post?
    Yes, except for Uncategorized.

    Re: the “files from 2011”: I moved them to another folder outside the wordpress folder and it made no changes to how the site functions. Still only one blog.

    Working on the Debug. I changed the false to true in config.php but nothing’s jumping out at me. This is what I inserted:

    define('WP_DEBUG', true);
    
    // Enable Debug logging to the /wp-content/debug.log file
    define('WP_DEBUG_LOG', true);

    Is it correct?

    Thread Starter murielleh

    (@murielleh)

    – First I tried adding that piece of code, you’ll see it in the index file linked to below, but it did not seem to fix the problem.

    – Here is the index.php code here
    https://pastebin.com/wARSMap7

    – However, now these “files from 2011” that weren’t there before are showing up in Editor under Child Theme:

    Theme Functions
    (files from 2011/functions.php)
    Main Index Template
    (files from 2011/index.php)
    Theme Functions
    (functions.php)
    Main Index Template
    (index.php)
    Page Of Posts Page Template
    (pageofposts.php)

    Styles

    Stylesheet
    (style.css)

    (In Finder (I’m on Mac), these are the files and folders in the twentyeleven-child folder:

    files from 2011 (a folder)
    functions.php
    index.php
    pageofposts.php
    screenshot.png
    style.css
    temp removed files (a folder))

    Not sure why these “files from 2011” showed up in there. Should I delete them?

    Any clues? Thanks again!!!

    Thread Starter murielleh

    (@murielleh)

    Oh, and I rechecked that it wasn’t a plugin caused the havoc. It’s not.

    Thread Starter murielleh

    (@murielleh)

    Not so resolved after all. Only the most recent blog shows now in the post page.

    – I have <!–more–> tags early on in every post
    – in Page Attributes, I have tried both Default template and Page Of Posts; no difference
    – in Settings>Reading I have allowed up to 10 posts per page
    – the blogs are allocated to the Blog page not the front page
    – each post has one category only

    and, as before, when I switch from my child theme to the 2011 parent theme, the problem disappears.

    Alchymyth, if you’re around and since you’ve looked at this issue before, any idea why this is? Or anyone else?

    Thanks so much.

    Thread Starter murielleh

    (@murielleh)

    Topic resolved.8

    Thread Starter murielleh

    (@murielleh)

    Ok thank you so much!

Viewing 15 replies - 1 through 15 (of 17 total)