BibleGateway Verse-of-the-Day

Current Version: BibleGateway VOTD Plugin 2.3

This plugin inserts BibleGateway.com‘s verse-of-the-day into pages or posts, or as a sidebar widget. It requires at least WordPress 2.5 as it uses WordPress’ shortcode API.

To use simply insert [bible-votd] in a page or post where you want the verse to appear, or use the Widget panel to drag and drop the Bible VOTD widget into your sidebar.

Using the Widget panel you can select the Bible version you want the widget to use. The version selected in the widget becomes the default version for the shortcode as well; however, you can override the shortcode version on a per use basis by using the “ver” option. For example, to use the KJV for a specific page or post write:

[bible-votd ver="9"]

Visit Bible Gateway’s web site for other translations that can be used.

Version History

2.3 (May 17/10) – Code optimizations. Added compatibility for WordPress versions as early as 2.5 and ensured PHP 4 and 5 compatibility.

2.2 (Jun. 24/09) – Updated attribute_escape to esc_attr to maintain current WordPress functions.

2.1 (Apr. 27/09) – Fixed a naming collision for the Title when using the sidebar widget.

2.0 (Feb. 20/09) – Added widget functionality. Verse of the day can now be included in sidebars of themes that are widget ready.

1.0 (Jun. 16/08) – Original release.

21 Comments for “BibleGateway Verse-of-the-Day”

  1. wonderingHow says:

    How would I use this as a widget in a sidebar?

  2. Dave says:

    At the moment the plugin isn’t coded to take advantage of the widget system in WordPress, so it won’t appear in the Widgets section. There are, however, a couple of easy workarounds.

    Option 1 (which I think is the easiest):

    Edit the sidebar.php file of your theme and add the following (inside the <?php ?> enclosures):

    echo do_shortcode(‘[bible-votd]‘);

    Inside the quotations is the shortcode, so you can also change Bible versions.

    Option 2 (a little more complicated but more versatile):

    In the bible-votd.php plugin, add the following code:

    add_filter(‘widget_text’, ‘do_shortcode’);

    At the end, after the line that reads:

    add_shortcode(‘bible-votd’, array(&$dzvotd_pluginSeries, ‘BibleVOTD’));

    Then you can use add a Text widget with the shortcode and it will substitute in the verse of the day.

    Let me know if you need more detailed instructions.

  3. chris glover says:

    The theme I have (WP hybrid news) doesn’t have a sidebar.php file so I chose your option #2. It wasn’t exactly as you said, but I added the code and this is what I have. Now on my website, it just has what I put in the text widget? What did I do wrong? Thank you, so much.

    if ( isset($dzvotd_plugin) ) {
    add_shortcode(‘bible-votd’, array(&$dzvotd_plugin, ‘BibleVOTD’)); add_filter(’widget_text’, ‘do_shortcode’);

    add_action(‘plugins_loaded’, array(&$dzvotd_plugin, ‘BibleVOTD_widget_init’));
    }

  4. chris Glover says:

    I just wrote to you needing help to get my “bible verse” working. I just wanted to say that I have it working now, so don’t bother to answer me. Its working wonderful and I want to thank you, so much, for having this available for everyone. God bless you, all

  5. Dave says:

    Hi Chris,

    Glad you got everything working!

  6. Bob Randklev says:

    I’ve installed the plugin and added the widget to the sidebar and the verse and link are showing up but there’s a large hard to view speaker that’s 300 pixels tall throwing the widget section off?

    Is there a way to remove the audio link and image or ???

  7. Dave says:

    This is likely caused by a conflict in CSS code somewhere. The widget encapsulates the BibleGateway verse in a class named biblevotd by default. You can use that to exception out conflicts. For example, to completely remove the image BibleGateway inserts to listen to the audio, you can add the following to your style.css file:

    .biblevotd img { display: none; }

    You could also also have the speaker appear properly by manually setting the width and height like this:

    .biblevotd img { width: 13px; height: 12px; }

  8. Woolf says:

    Is there a way to make the links from the BibleGateway VOTD Plugin open in a new page rather than in the same page? I tried adding in target=”_blank” in what I thought were the sections creating the links in the plugin, but this just caused the plug in to fail.

  9. Dave says:

    The plugin simply inserts the JavaScript code provided by BibleGateway. When the browser reaches that code, it loads the JavaScript from BibleGateway’s web site. That code contains the bible verse and links. As it is now, there’s nothing in the plugin that could be modified to alter the content from BibleGateway’s web site.

    One possible solution would be to load the verse from BibleGateway in the back-end, using PHP to open the remote URL. However, if BibleGateway is down or running slow, this will cause significant page load issues or time outs.

    The best possible solution I can think of would be to use another JavaScript function that intercepts link clicks and forces them to open in a new window. JQuery could probably do it and there may even be plugins that exist already for WordPress that will take care of it for you. This particular feature is not something I plan to incorporate into the plugin so an alternate solution would be your best bet if you absolutely need the links to open in a new window.

  10. Richard says:

    I really like this plugin and having automatic links to BibleGateway for each Bible verse. However, when I have the plugin activated it takes my site about 2-4 minutes to load a page (if it ever loads at all). When I deactivate the plugin my pages load immediately. Is there some way to get around this?

  11. Dave says:

    Hi Richard,

    The plugin inserts the JavaScript code which BibleGateway.com provides for displaying the verse of the day. This JavaScript code then loads the verse directly from their server. If their server is running slow, page loading could halt on your site until either the loading finishes or the script times out. If you try using the plugin at a different time of the day you’ll probably notice things loading quicker—since this really depends on their server load.

    So there is nothing wrong with the plugin, it is simply an issue of having to wait for another site. A similar issue can happen, for example, if inserting Twitter feeds onto your site and Twitter.com goes down or is running slow.

    I will investigate the option of having the plugin wait until the DOM has loaded before inserting the code. This would require more JavaScript to execute during each page load, but could avoid this type of delay.

  12. Gayatri says:

    Hey.
    So a little confused.
    I installed this on a client site, and I put the shortcode in a post.
    What I really want is for this to refresh daily and show up in a ‘category’ called daily verse every day.

    How can i do this?

  13. Dave says:

    If I understand you correctly, you want each verse of the day to almost as a new post in its own category? That’s really not the function of this plugin. The plugin simply pulls BibleGateway.com’s verse of the day and inserts it wherever the shortcode or widget exists.

    The shortcode option is there because it lets users put the verse on a page. That it works within posts is a carry-over to the way WordPress processes text. I could have removed the option but it would be an extra line of code to do it and didn’t seem necessary.

    Having BibleGateway’s verse appear as a new post is certainly possible for a plugin based on the way WordPress is built but beyond the scope of this particular plugin.

  14. Hi,
    I am trying to have the plugin show up on the home page. For which I need to include code in a PHP file. The plugin works fine in a post or a page. But how do I get to show up the plugin using the short code in the PHP file. Is there a seperate PHP code to show the plugin in the website. Please let me know how I can fix this error.

    Thanks,
    Jeeva

  15. Dave says:

    Hi Jeeva,

    Inside your PHP code you would do something like this:

    echo do_shortcode( '[bible-votd]' );

    All of the available options for the shortcode are also usable. So you can force the use of, for example, the KJV by using:

    echo do_shortcode( '[bible-votd ver="9"]' );

  16. nikedunkhi says:

    A possible solution is loaded in the back lines from BibleGateway using PHP to open a remote URL. However, if the BibleGateway shut down or running slowly, it will cause major problems loading the page or time out.
    The opinion post above by them maybe right !

  17. Dave Zaikos says:

    Yes, I have considered this solution as well. Delays on BibleGateway.com’s end could be circumvented by using WordPress’s internal cron schedule to do the fetching and cache the results. It would only need to be done once daily (around 5:00 a.m. UTC). Using cron would result in WordPress fetching the verse during a load that is not associated with displaying the web site to the visitor; so there would be no slow down. However, I am reluctant to implement this because it depends on the web server being able to fetch external data and BibleGateway.com may not have updated their verse during the load, which means we’d have to make multiple attempts to get the new verse. It honestly seems like a waste of server resources for something so small.

    To be quite honest, the best solution would be for BibleGateway to allow a JSONP request for the information. This would let us skip their JavaScript code altogether and use jQuery to load the content and display it as we see fit.

    Nevertheless, there are a few options I’m looking at and plan to test for the next release.

    Update: It looks like Bible Gateway has updated their site to support JSON requests. This means I can update the plugin so it loads the verse after the rest of the page has loaded. Not sure when I’ll have the update out, but you can expect that in the next version.

  18. Mike says:

    Is it possible to excerpt or truncate the verse of the day results? I’d like to display an excerpted version on our homepage and link it to the post.

    I only want to truncate this post and no others.

    Any help would be appreciated.

    Thanks,

    Mike

  19. Dave Zaikos says:

    The verse is handled client-side so this would have to be done with JavaScripting after the content is loaded. I am planning to release an updated version in the near future that utilizes jQuery to make JSON requests (this would prevent the page loading from pausing if Bible Gateway’s web site was running a bit slow), but because WordPress is merely injecting JavaScript into the page, there’s nothing internal that would allow for excerpting.

    This kind of ties in with an earlier comment and the solution would be the same: Have WordPress query Bible Gateway on a cron schedule, cache the verse and serve it up. If the verse were cached, WordPress could manipulate it any way we want. It could even be pluggable so one could add an “apply_filters” in their functions.php theme file to filter the text in some way. I suppose it could be done—I’ll consider it—but I can’t promise it for the next release.

  20. I see the new CEB is on the Bible Gateway site. Can it be added to the list in the plug in? We just started using this and really like it. Thanks for all the hard work on this plug in. Kurt Gwartney, minister of communications.

  21. Dave Zaikos says:

    Yes, I will add this version if it’s available for the verse of the day.

Leave a Comment