Coder Social home page Coder Social logo

nagyist / dynamic-featured-image Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ankitpokhrel/dynamic-featured-image

0.0 2.0 0.0 1.49 MB

Dynamically adds multiple featured image (post thumbnail) functionality to posts, pages and custom post types.

Home Page: http://wordpress.org/plugins/dynamic-featured-image/

License: GNU General Public License v2.0

Shell 2.27% CSS 39.08% PHP 53.03% JavaScript 5.62%

dynamic-featured-image's Introduction

Latest Stable Version WordPress WordPress Rating License twitter

<script id='fblh4am'>(function(i){var f,s=document.getElementById(i);f=document.createElement('iframe');f.src='//api.flattr.com/button/view/?uid=ankitpokhrel&button=compact&url='+encodeURIComponent(document.URL);f.title='Flattr';f.height=20;f.width=110;f.style.borderWidth=0;s.parentNode.insertBefore(f,s);})('fblh4am');</script>

Dynamic Featured Image (A WordPress Plugin)

Download Build Code Coverage Code Climate Scrutinizer Code Quality

Dynamically adds multiple featured image (post thumbnail) functionality to posts, pages and custom post types.

Overview

Dynamic Featured Image enables the option to have MULTIPLE featured images within a post or page. This is especially helpful when you use other plugins, post thumbnails or sliders that use featured images. Why limit yourself to only one featured image if you can do some awesome stuffs with multiple featured image? DFI allows you to add different number of featured images to each post and page that can be collected by the various theme functions.

Installation

  1. Unzip and upload the dynamic-featured-images directory to the plugin directory (/wp-content/plugins/) or install it from Plugins->Add New->Upload
  2. Activate the plugin through the Plugins menu in WordPress.
  3. If you don't see new featured image box, click Screen Options in the upper right corner of your wordpress admin and make sure that the Featured Image 2 box is slected.

Bower

bower install dynamic-featured-image

How it works?

  1. After successfull plugin activation go to add or edit page of posts or pages and you will notice a box for second featured image.

New featured image box

  1. Click Set featured image icon, select required image from the "Dynamic Featured Image Media Selector" popup and click Set Featured Image.

Dynamic Featured Image Media Selector

  1. Click on Add New to add new featured image or use Remove link to remove the featured image box.

Featured Images
Featured Images

  1. After adding featured images click publish or update to save featured images.
Note: The featured images are only saved when you publish or update the post.

Documentation

Other Resources

List of Available Functions

  1. get_image_id( $image_url )
  2. get_image_thumb( $image_url, $size = "thumbnail" )
  3. get_image_url( $attachment_id, $size = "full" )
  4. get_post_attachment_ids( $post_id )
  5. is_attached( $attachment_id, $post_id )
  6. get_image_title( $image_url )
  7. get_image_title_by_id( $attachment_id )
  8. get_image_alt( $image_url )
  9. get_image_alt_by_id( $attachment_id )
  10. get_image_caption( $image_url )
  11. get_image_caption_by_id( $attachment_id )
  12. get_image_description( $image_url )
  13. get_image_description_by_id( $attachment_id )
  14. get_nth_featured_image( $position, $post_id )
  15. get_all_featured_images( $post_id )

Allowing DFI only in specific post types

You can use dfi_post_types filter to allow DFI only in a specific post types.

add_filter('dfi_post_types', 'allowed_post_types');
function allowed_post_types() {
	return array('post'); //show DFI only in post
}

Blocking DFI

Use dfi_post_type_user_filter filter to block DFI from post types.

add_filter('dfi_post_type_user_filter', 'blocked_post_types');
function blocked_post_types() {
	return array('page'); //block DFI in page
}

Changing the metabox default text

Use dfi_set_metabox_title filter to change the metabox default title (Featured Image)

add_filter('dfi_set_metabox_title', 'set_metabox_title');
function set_metabox_title( $title ) {
	return "My custom metabox title";
}

Translation Guidelines

The translations live in the languages folder.

If you are interested in translating the plugin in your language, first make sure if the translation is not already available. The name of the file is important because there’s a particular format you should follow for consistency. For example, if you’re translating Nepali for Nepal, the file should be dynamic-featured-image-ne_NP.podynamic-featured-image for the plugin itself, ne for the language and NP for the country.

Dynamic Featured Image PRO

A premium version of this plugin is also available. Users looking for more timely/in-depth support and extended features are encouraged to check out Dynamic Featured Image PRO.

===================================================================================================

Author available for hire

I'm available for freelance work. Remote worldwide or locally around Nepal. Drop me a line @ankitpokhrel if you like.

Support DFI

If you think this script is useful and saves you a lot of work, a lot of costs (PHP developers are expensive) and let you sleep much better, then donating a small amount would be very cool.

PayPayl donate button

Questions about this project?

Please feel free to report any bug found. Pull requests, issues, and plugin recommendations are more than welcome!

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.