Comments (15)
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.
For example, you should be able to inset Efficient Related Posts using the same method I described here:
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.
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.
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.
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.
@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.
@raamdev I see. I removed it, now one of the 2 is happening:
- It is not showing related posts in certain posts, like http://www.sergioschuler.com/got-startup-googles-first-page-month-without-seo-expertise/
- 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.
@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.
@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.
Notice the lack of top admin bar. There is nothing under the main title.
Only thing that loads in this post is the little blue bar from highlighter (top right)
from independent-publisher.
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.
I will try Microkid's plugin.
from independent-publisher.
@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.
@raamdev I ended up trying another plugin. Not sure what happened there.
from independent-publisher.
@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)
- Disabling Customizer? HOT 1
- "Full Size Featured Image" support for Gutenberg
- Caption alignment
- Gutenberg: 'Use as post cover' option not available
- Advice for blogger who likes Independent Publisher HOT 1
- Wordpress.com tags not showing under posts HOT 1
- In combination with Mollie donations plugin input css issue HOT 1
- Avatar showing 100x100px version in some cases
- Child theme stylesheet version ignored
- Webmentions are hidden when comments are disabled HOT 3
- Change fonts and Estimate time bugs HOT 1
- no styles are applied HOT 1
- Header images should use get_header_image_tag()
- PHP 8.1 throws a Warning HOT 1
- There is no Mastodon icon in the social icons menu HOT 5
- Theme moving HOT 3
- Have an extra newline after a quote block HOT 1
- Author link override affects ActivityPub plugin
- Webmentions (pingbacks) throw a notice
- Header image on archive and category pages HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from independent-publisher.