Git Product home page Git Product logo

Comments (15)

raamdev avatar raamdev commented on September 2, 2024

Are you using the official Efficient Related Posts plugin or my fork?

It's probably not showing up because I removed plugin-specific code from the theme in favor of being able to call functions to inset code using filters and actions.

from independent-publisher.

raamdev avatar raamdev commented on September 2, 2024

For example, you should be able to inset Efficient Related Posts using the same method I described here:

#44 (comment)

I'm on my phone right now, but the next time I'm on the laptop I'll see if I can post some example code here for Efficient Related Posts.

from independent-publisher.

manishsuwal avatar manishsuwal commented on September 2, 2024

I installed your fork of the Efficient Related Posts plugin but it kept giving me Update notifications.
So, I deleted it and used the original Efficient Related Posts plugin.

If you have removed plugin-specific code from the theme, then it makes sense. I will have to use Efficient Related Posts action hook myself, right?

from independent-publisher.

raamdev avatar raamdev commented on September 2, 2024

You should be able to add the following to a Child Theme's functions.php to add Efficient Related Posts to the bottom of your posts:

function independent_publisher_show_further_reading() {
    if ( is_single() && function_exists( 'wp_related_posts' ) ) :
        echo '<div id="further-reading">';
        do_action( 'erp-show-related-posts', array( 'title' => 'Further Reading', 'num_to_display' => 5, 'no_rp_text' => 'No Related Posts Found' ) );
        echo '</div>';
    endif;
}
add_action( 'independent_publisher_before_post_bottom_tag_list', 'independent_publisher_show_further_reading', 10 );

I will be updating the Further Reading plugin soon, to work nicely with Independent Publisher; please watch that repo if you want to receive updates for that plugin. :)

from independent-publisher.

sergioschuler avatar sergioschuler commented on September 2, 2024

I can't add this to my functions.php in the child theme because then I get the white screen of death. Here is the whole file:

<?php
/**
 * You can add your own functions here. You can also override functions that are
 * called from within the parent theme functions.php. See below for an example.
 *
 */
// Uncomment this line to hide the post word count:
// function independent_publisher_get_post_word_count() { return false; }
// Uncomment this line to enable multi-author mode:
// function independent_publisher_is_multi_author_mode() { return true; }
/* Removes logo display:none when not on top */
    function independent_publisher_site_logo_icon_js() {
        return;
    }
/* end Removes logo display:none when not on top */
?>
<?php
    function independent_publisher_show_further_reading() {
    if ( is_single() && function_exists( 'wp_related_posts' ) ) :
        echo '<div id="further-reading">';
        do_action( 'erp-show-related-posts', array( 'title' => 'Further Reading', 'num_to_display' => 5, 'no_rp_text' => 'No Related Posts Found' ) );
        echo '</div>';
    endif;
    }
    add_action( 'independent_publisher_before_post_bottom_tag_list', 'independent_publisher_show_further_reading', 10 );
?>

from independent-publisher.

raamdev avatar raamdev commented on September 2, 2024

@sergioschuler Ah, sorry, my code sample assumed that you weren't using my fork of the Efficient Related Posts plugin (Further Reading), which already includes independent_publisher_show_further_reading() and takes care of inserting the related posts lists when used with the Independent Publisher theme.

The white screen of death is happening because you're trying to redeclare independent_publisher_show_further_reading() a second time.

If you're using my fork of Efficient Related Posts (i.e., you're using my Further Reading or IndiePub Further Reading plugin), then you shouldn't need to add anything to your functions.php file.

If you're using Efficient Related Posts, then my above code should work just fine.

from independent-publisher.

sergioschuler avatar sergioschuler commented on September 2, 2024

@raamdev I see. I removed it, now one of the 2 is happening:

  1. It is not showing related posts in certain posts, like http://www.sergioschuler.com/got-startup-googles-first-page-month-without-seo-expertise/
  2. Certain posts are not loading properly (at all) like http://www.sergioschuler.com/startup-lessons-learned-from-my-failed-startup/

UPDATE: Will disable the plugin so things go back to normal

from independent-publisher.

raamdev avatar raamdev commented on September 2, 2024

@sergioschuler Can you take a screenshot for me so I can see the problem? I just checked those posts and they both look fine (but you had probably already deactivated the plugin).

If it's not showing related posts for a given post, that might have something to do with the plugin having not generated enough (or all) of the relationships between posts to have a list of related posts to show.

from independent-publisher.

sergioschuler avatar sergioschuler commented on September 2, 2024

@raamdev I re-enabled the plugin so you can check: http://www.sergioschuler.com/startup-lessons-learned-from-my-failed-startup/

UPDATED: This is a bit different, but also the same issue: http://www.sergioschuler.com/wont-validate-product-using-landing-page-get-fit-without-exercise/

from independent-publisher.

sergioschuler avatar sergioschuler commented on September 2, 2024

screenshot 16
Notice the lack of top admin bar. There is nothing under the main title.

screenshot 17
Only thing that loads in this post is the little blue bar from highlighter (top right)

from independent-publisher.

raamdev avatar raamdev commented on September 2, 2024

OK, I see what's happening. I have to leave the office right now, so I'll have to debug this tomorrow.

Have you tried using the original Efficient Related Posts plugin + adding the code I recommended above to your functions.php file? I want to rule out the possibility of a problem with my fork.

I'm using my fork (Further Reading) with no issues on my local dev install (which has a copy of all my data from raamdev.com, around 1200 posts), but I haven't tested it thoroughly with this theme.

This problem also might be a conflict with another plugin that you're using.

from independent-publisher.

sergioschuler avatar sergioschuler commented on September 2, 2024

I will try Microkid's plugin.

from independent-publisher.

raamdev avatar raamdev commented on September 2, 2024

@sergioschuler Did you get a chance to figure this out? I'm at a loss as to what might've been causing the issues you were seeing, as I'm not able to reproduce the issue. My only guess is that a conflict with another plugin is the issue.

from independent-publisher.

sergioschuler avatar sergioschuler commented on September 2, 2024

@raamdev I ended up trying another plugin. Not sure what happened there.

from independent-publisher.

raamdev avatar raamdev commented on September 2, 2024

@sergioschuler Got it. I've still been unable to reproduce this, but I've opened an issue on the Further Reading repo for future reference and will close this issue now.

from independent-publisher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.