Skip to content

Commit

Permalink
Merge pull request #26 from okfn/2019-update-fixes
Browse files Browse the repository at this point in the history
2019 update fixes
  • Loading branch information
gocemitevski authored May 10, 2022
2 parents f7884f9 + 07f184b commit 6dad996
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 26 deletions.
24 changes: 10 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,27 @@
OKFN WordPress Theme
=================
# OKFN WordPress Theme

OKFNWP is a WordPress theme built on Bootstrap.

Getting Started
---------------
## Getting Started

**You'll need the following installed before continuing:**
* [Node.js](http://nodejs.org): Use the installer provided on the NodeJS website.
* [Grunt](http://gruntjs.com/): Run `[sudo] npm install -g grunt-cli`

* [Node.js](http://nodejs.org): Use the installer provided on the NodeJS website.
* [Grunt](http://gruntjs.com/): Run `[sudo] npm install -g grunt-cli`

To get started run:

`npm install && grunt watch`

## Templates

Templates
---------

**Homepage**
### **Homepage**

The homepage template is a regular full-width content page. Use the `[latestposts]` shortcode to display the latest blog posts.

## Shortcodes

Shortcodes
----------

**Latest Blog Posts**
### **Latest Blog Posts**

To add a 3-column row of the latest blog posts, use:

Expand Down
14 changes: 2 additions & 12 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ function okfn_is_post_rendered( $post ) {
}

function okfn_get_first_image_url_from_post_content() {
global $post, $posts;
global $post;

$first_img_url = '';
$is_image_file = false;
Expand All @@ -325,17 +325,7 @@ function okfn_get_first_image_url_from_post_content() {

endif;

// Check if the image URL points to an actual image file
// ---------------------------------------------------------------------------
if ( function_exists( 'getimagesize' ) ) :

if ( ! empty( $first_img_url ) ) :
$is_image_file = getimagesize( $first_img_url );
endif;

endif;

if ( empty( $first_img_url ) || ! $is_image_file ) :
if ( empty( $first_img_url ) ) :

// Reset value if no image is available
$first_img_url = false;
Expand Down

0 comments on commit 6dad996

Please sign in to comment.