• Resolved stug2013

    (@stug2013)


    Hi, I have been making some changes to the theme using the customize interface but I seem to have lost my related posts. I have checked the settings for single post and it seems to be set to related posts by category. Keep looking but can’t find where else I might have changed by mistake. The website is: http://loveyogaanatomy.com
    Thanks for your help
    Stu

Viewing 15 replies - 1 through 15 (of 34 total)
  • Hi Stu. Do you have a modified single.php theme template file in a child theme?

    Thread Starter stug2013

    (@stug2013)

    Hey bdbrown, I have modified single, page and functions php file in the child theme but I haven’t changed anything recently.

    What you’ll find in the new version is that several of the object names and locations have changed. For example, in your child theme single.php file you’ll probably see this:

    <?php if ( ot_get_option( 'related-posts' ) != '1' ) { get_template_part('inc/related-posts'); } ?>\

    In the new version that has been changed to this:

    <?php if ( '1' != hu_get_option( 'related-posts' ) ) { get_template_part('parts/related-posts'); } ?>

    What I’d recommend is making a note of the modifications that you made to your single.php file, copy the new version of the file to your child theme (overwriting the current version) and reapply your changes. Likewise, if you’ve copied theme-specific functions from the parent theme into your child theme you should check those as well as some of those have been renamed. Most of the theme functions are now in these two files:
    /functions/init-core.php
    /functions/init-front.php

    Most of the css element selector names have remained the same. One thing different is that you no longer need to import or enqueue the parent stylesheet. The theme loads both the parent and child stylesheets automatically.

    Thread Starter stug2013

    (@stug2013)

    thanks bdbrown I will take a look.
    I was also wondering whether with all the updates to the theme is it possible yet to add content to the front page if it is set to blog. I have tried to add a dynamic widget area but it doesn’t become active so I gather that is not allowed. I would like to put some gridded content between the slider and blog posts.

    You can do that but there aren’t any pre-defined widget areas or hooks in the page. You’d need to modify index.php and add a call to the dynamic sidebar. I can come up with some code if you’re interested.

    Thread Starter stug2013

    (@stug2013)

    That would be fantastic.
    Let me just clarify with you what I was thinking so that i don’t waste your time. The home page is set to blog with the content layout at the moment having a featured posts slider and underneath the blog posts, it has a sidebar on the right. http://loveyogaanatomy.com/
    What I was thinking was to remove the sidebar on the front page making it full width. Would the columns of posts automatically go to three with the extra space available?
    Then I would like to add a content area between the slider and the blog posts that I could add images to as links to other pages. Could be a masonary grid. I was thinking a widget area or two might be the easiest way to go. Would you have any input as to why this might be a bad idea as the combination of blog and normal content doesn’t seem to be done often.

    Thread Starter stug2013

    (@stug2013)

    Just another thought. would it be easier to have a static front page and the add a widget area that you can the use to list x number of posts. Although I think I read something before by yourself that said this approach would mess up the way that category and search pages displayed the posts.

    Would the columns of posts automatically go to three with the extra space available?

    No, but you can modify the page layout parameters and css to make it 3 wide.

    hy this might be a bad idea

    Only thing I can think of is that some people think static content negatively affects your SEO since it’s not dynamic. I don’t know where I read that; maybe I just made it up 😉 Seriously though, if you had an all-static-content page that never changed you probably wouldn’t be very worried about SEO. Since your site has an active blog I don’t think (just my opinion here) that a small bit of static content is going to affect your ratings.

    would it be easier to have a static front page

    If your primary focus is a blog I wouldn’t recommend this approach. It’s doable but why try to rework the CMS when it’s already built to do what you want.

    Thread Starter stug2013

    (@stug2013)

    Ok so we would be going with keeping the front page as a blog and just adding some content as described before.

    OK. Might be a two or three hours before I can get back to you.

    Thread Starter stug2013

    (@stug2013)

    Thank you so much. This is not the first time you have helped me out. I very much appreciate all the time you give to assist people with this theme.

    Give this a try:
    1. Create your dynamic widgets (sidebars) and note the unique ids.
    2. Add the widgets to the sidebars.
    3. Copy index.php to your child theme.
    4. Add the calls for the dynamic sidebars, using the unique ids, below the featured posts line:

    <?php if ( hu_is_checked('featured-posts-enabled') ) { get_template_part('parts/featured'); } ?>
    
    <?php dynamic_sidebar( 'hu_sidebars_10' ); ?>
    <?php dynamic_sidebar( 'hu_sidebars_11' ); ?>
    
    <?php if ( have_posts() ) : ?>

    5. The sidebars will be stacked at 100% width. You can use some css to space them top and bottom if needed. If you want them side-by-side, use something like this:

    /* dynamic sidebars side-by-side */
    .home .content .widget {
      float: left;
      margin: 10px 0 20px 1%;
      width: 48%;
    }

    6. To set the posts to 3 columns, in this line in index.php:

    <?php if($i % 2 == 0) { echo '</div><div class="post-row">'; } $i++; endwhile; echo '</div>'; ?>

    Change ($i % 2 == 0) to ($i % 3 == 0)

    7. Add this custom css:

    .home .post-list .post {
    width: 33%;
    }

    Hi bdbrown – if you are there?!

    I’m having trouble with an error on our site that relates to ‘related posts’ as well and wondering if you could help me as I really don’t know what to do!

    Our site is http://cycleevents.com. If you go to a Category in the menu- say QLD we get this : Fatal error: Call to undefined function get_field() in /home3/guzzba/network/cycleevents.com/wp-content/themes/CycleEvents_Explorer/category.php on line 23

    Can you help me with fixing this?

    Many thanks,
    Claire
    claire@teddermain.com

    Update – ok I’ve fixed that problem!

    Just now having a problems with posts not appearing – think there’s a plugin conflict!

    I’ll keep working on it,

    Cheers.

Viewing 15 replies - 1 through 15 (of 34 total)
  • The topic ‘seem to have lost related posts’ is closed to new replies.