Giter Club home page Giter Club logo

ankitpokhrel / dynamic-featured-image Goto Github PK

View Code? Open in Web Editor NEW
105.0 9.0 33.0 838 KB

[WordPress Plugin] Dynamically adds multiple featured image (post thumbnail) functionality to posts, pages and custom post types. [850k+ downloads and 100k+ active installs]

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

License: GNU General Public License v2.0

Shell 6.33% CSS 1.67% PHP 84.64% JavaScript 7.36%
wordpress wordpress-plugin post-thumbnails featured-image php wordpress-development made-in-nepal

dynamic-featured-image's People

Contributors

ahmednuaman avatar ankitpokhrel avatar bitdeli-chef avatar bogdanfix avatar bruno-rodrigues avatar cfoellmann avatar danielbachhuber avatar glebkema avatar isudnop avatar oyovadaniel avatar s8nsick66 avatar swiffer avatar tobros91 avatar tom-henderson avatar vlad-stratulat avatar zsmartin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dynamic-featured-image's Issues

php 7.2 warning for new posts

'dfiFeatured' post meta doesn't exist for new posts, and it returns an empty string, which raises a warning in php 7.2 when tried to be counted:

Warning: count(): Parameter must be an array or an object that implements Countable in dynamic-featured-image.php on line 244

http://php.net/manual/en/migration72.incompatible.php#migration72.incompatible.warn-on-non-countable-types

Could be fixed by checking result type beforehand:
$total_featured = is_array( $featured_data ) ? count( $featured_data ) : 0;

WP 3.6.1, multisite: No settings page and plugin activation

Maybe I missed it, but I did not see a settings page after installation on a WP multisite.

I checked the "settings" section of the network admin and the settings page of a blog.

I was using Version 1.1.2 of your plugin (I've uninstalled for now).

Also, I'm not sure if this is related, but after "network activating" your plugin, the plugin was immediately available to all blogs. I'm not sure if this is a standard thing as most plugins I've used have to be activated on each individual blog (after network activation takes place).

To clarify, normally I "network activate" a plugin, and then go to each blog and selectively "activate" the plugin from there.

Possibly related #4.

Random in a theme

Hello,
I try to do a random display in a content-page.php... It doesn't work. How can I do ? For the moment, I use this for simple thumbnails

<?php if( has_post_thumbnail() ): ?>
    <figure class="post-thumbnail">
        <?php
            $thumbnails = get_posts('numberposts=3');
            foreach ($thumbnails as $thumbnail) :
                setup_postdata($post);
                if ( has_post_thumbnail()) :  
                    the_post_thumbnail(full); 
                endif;
            endforeach;
        ?>
    </figure>
<?php endif; ?>

Thank you for your answer :)

Desperately trying to display the second featured image...

Hi,
I have installed version 3.7 of the plugin and I am trying to display the second featured image of a custom post as the background....

I can easily display the original/first featured image with this:

<div class="class1 <?php echo $style_class; ?>"
     style="background-attachment: fixed; background-position:top;
            background-image:url('<?php the_post_thumbnail_url(); ?>')"
>

But I can not figure out how to get the URL of my second featured image.... I have tried this inside the url(' ') piece of code :

1st attempt: (didnt work)

$img = dfi_get_featured_images(); $url=$img['full']; echo '$full';

2nd attempt: (didnt work)

while (have_posts()) : the_post();
    if (class_exists('Dynamic_Featured_Image')) {
        global $dynamic_featured_image;
        $featured_images = $dynamic_featured_image->get_featured_images();
        echo $featured_image['full'];
    }
endwhile;

3rd attempt: (didnt work)

global $dynamic_featured_image;
$second_featured_image = $dynamic_featured_image->get_nth_featured_image(2);
foreach ($featured_images as $key => $value) {
    echo $value['full'];
}

The documentation is really not clear about how to get the URL of an uploaded second featured image.... Some clarifications would be more than welcome... Thanks a million.

Insert images in order But When Modify... images messy

Hi,
Why is this happening to me?
When I enter a new post with images that I post in an orderly fashion, everything is recorded well. But when editing the post to alter part of the content ... The images appear all messy. The weirdest thing is that the json stored in the database is correctly ordered.
Sorry my bad english
I home the image helpt to see de behaviour
Best Regards

Step 1: Insert
step-1-add

Step 2: Modify
step-2-update

Dynamic height

Hi, I inherited a web that includes this plugin. The problem I'm having is that the generated slider has a fixed height of the bigger image, resulting in an ugly white margin between the image and the thumbnails.

Is there a way to change that?

Thanks

Latest version not getting the first featured image - only #2 on.

I've just downloaded and installed the latest version 3.1.2 and after adding multiple featured images to my post the featured image retrieval method as specified in your docs is only getting the 2nd featured image and on from there. NO 1st image is in the array.

Thanks.

<?php if( class_exists('Dynamic_Featured_Image') ) {
    global $dynamic_featured_image;
    $featured_images = $dynamic_featured_image->get_featured_images( );

    print_r( $featured_images );

    // ONLY SHOWS ARRAY WITH 2nd IMAGE ON

} ?>

... << rest of Post Loop >>

WP 3.6.1, Multisite: PHP "Notice" after install

First, just want to say that I love this plugin. I wish this functionality was built into WP core. Thanks for sharing your code!

With that said, I got these PHP notices right after installing (I think they popped up after network activating, during my switch from the network admin to a testing blog):

[10-Oct-2013 00:15:29 UTC] PHP Notice:  Trying to get property of non-object in /xxxxxxxxxx/wp-content/plugins/dynamic-featured-image/dynamic-featured-image.php on line 171
[10-Oct-2013 00:15:29 UTC] PHP Notice:  Trying to get property of non-object in /xxxxxxxxxx/wp-includes/capabilities.php on line 1072
[10-Oct-2013 00:15:29 UTC] PHP Notice:  Trying to get property of non-object in /xxxxxxxxxx/wp-includes/capabilities.php on line 1076
[10-Oct-2013 00:15:29 UTC] PHP Notice:  Trying to get property of non-object in /xxxxxxxxxx/wp-includes/capabilities.php on line 1078
[10-Oct-2013 00:15:29 UTC] PHP Notice:  Trying to get property of non-object in /xxxxxxxxxx/wp-includes/capabilities.php on line 1079
[10-Oct-2013 00:15:29 UTC] PHP Notice:  Trying to get property of non-object in /xxxxxxxxxx/wp-includes/capabilities.php on line 1079
[10-Oct-2013 00:15:29 UTC] PHP Notice:  Trying to get property of non-object in /xxxxxxxxxx/wp-includes/capabilities.php on line 1082
[10-Oct-2013 00:15:29 UTC] PHP Notice:  Trying to get property of non-object in /xxxxxxxxxx/wp-includes/capabilities.php on line 1082
[10-Oct-2013 00:15:29 UTC] PHP Notice:  Trying to get property of non-object in /xxxxxxxxxx/wp-content/plugins/dynamic-featured-image/dynamic-featured-image.php on line 172
[10-Oct-2013 00:15:29 UTC] PHP Notice:  Undefined index: dfiFeatured in /xxxxxxxxxx/wp-content/plugins/dynamic-featured-image/dynamic-featured-image.php on line 172

Not sure what capabilities.php is. Anyway, it's they're just PHP notices, so not a biggy I guess, just thought you'd like to know.

Thanks!

Crop image issue

//functions.php
add_theme_support( 'post-thumbnails', array( 'post' ) );
add_image_size( 'small_land', 666, 375, true ); // i want to show it but dont work


// query page

if( class_exists('Dynamic_Featured_Image') ) {
       global $dynamic_featured_image;
       $featured_images = $dynamic_featured_image->get_featured_images();
       foreach($featured_images as $featured_image) {
        echo '$featured_image['thumb'];
        echo '$featured_image['small_land']; // i want to show it but dont work
       }
 }

Problem Retrieving Images in HTTPS Protocol

As submitted by "Bernardo Cecioni" from email:

I ran into a problem and I'd like to ask you some help. I have a piece of code in my page that generates a slideshow from your plugin's images: everything went fine until I enabled an ssl certificate for my admin area and, as a consequence, all the images url assigned to your plugin during the new pages creation were, from that moment on, with "https"...and here are the problems: while all the old slideshows kept to work (with http images), all the new ones do not. It seems that assigning to your plugin an https image cause some issue.

Code review

I hope you don't mind, but I took the liberty of doing a quick code review of the plugin. I've added @todo comments in the source, and here's the diff:

diff --git a/dynamic-featured-image.php b/dynamic-featured-image.php
index ff7e141..b545ca7 100644
--- a/dynamic-featured-image.php
+++ b/dynamic-featured-image.php
@@ -74,7 +74,7 @@ class Dynamic_Featured_Image {
        add_action( 'plugins_loaded',   array( $this, 'load_plugin_textdomain' ) );

        //handle ajax request
-       add_action( 'wp_ajax_nopriv_dfiMetaBox_callback',   array( $this, 'ajax_callback' ) );
+       add_action( 'wp_ajax_nopriv_dfiMetaBox_callback',   array( $this, 'ajax_callback' ) ); // @todo nopriv action should be removed
        add_action( 'wp_ajax_dfiMetaBox_callback', array( $this, 'ajax_callback' ) );

        $this->upload_dir = wp_upload_dir();
@@ -132,7 +132,7 @@ class Dynamic_Featured_Image {
    public function initialize_featured_box() {

        global $post;
-       $data = get_post_custom( $post->ID );
+       $data = get_post_custom( $post->ID ); // @todo Why not use get_post_meta( $post->ID, 'dfiFeatured', true )?

        $totalFeatured = 0;
        $featuredData = array();
@@ -284,10 +284,11 @@ class Dynamic_Featured_Image {
     * @return Void
     */
    public function ajax_callback() {
+       // @todo lacking cap check?

        $featuredId = isset($_POST['id']) ? (int) strip_tags( trim( $_POST['id'] ) ) : null;

-       if ( is_null( $featuredId ) ) {
+       if ( is_null( $featuredId ) ) { // @todo The above can simple cast to an int, and instead of is_null() here use empty()
            return;
        }

@@ -350,7 +351,7 @@ class Dynamic_Featured_Image {

        $keys = array_keys( $_POST );
        foreach ( $keys as $key ) {
-           if ( preg_match( '/dfi_fimageplug-.$/', $key ) ) {
+           if ( preg_match( '/dfi_fimageplug-.$/', $key ) ) { // @todo /dfi_fimageplug-.$/ should probably be /dfi_fimageplug-\d+$/
                //Verify nonce
                if ( !wp_verify_nonce( $_POST[$key], plugin_basename(__FILE__) ) ) {
                    return;
@@ -384,7 +385,7 @@ class Dynamic_Featured_Image {
    /** Helper functions */

    private function execute_query( $query ) {
-       $resultSet = $this->db->get_col( $query );
+       $resultSet = $this->db->get_col( $query ); // @todo why not use $wpdb->get_col() directly? And actually, $wpdb->get_var() is what you want here.

        return empty( $resultSet ) ? null : $resultSet[0];
    }
@@ -402,7 +403,7 @@ class Dynamic_Featured_Image {
     */   
    public function get_image_id( $image_url ) {        

-       return self::execute_query($this->db->prepare( "SELECT ID FROM " . $this->prefix . "posts" . " WHERE guid = %s", $image_url ));
+       return self::execute_query($this->db->prepare( "SELECT ID FROM " . $this->prefix . "posts" . " WHERE guid = %s", $image_url )); // @todo should use $wpdb->posts and value should be cached

    } // END get_image_id()

@@ -462,7 +463,7 @@ class Dynamic_Featured_Image {
            //check if the image is edited image
            //and try to get the attachment id  
            $image_url = str_replace($this->upload_url . "/", '', $image_url);              
-           $row = self::execute_query( $this->db->prepare( "SELECT post_id, meta_key FROM " . $this->prefix . "postmeta WHERE meta_value = %s", $image_url ) );
+           $row = self::execute_query( $this->db->prepare( "SELECT post_id, meta_key FROM " . $this->prefix . "postmeta WHERE meta_value = %s", $image_url ) ); // @todo should use $wpdb->postmeta instead and value should be cached
            if( !is_null($row) ) {
                $attachment_id = $row['post_id'];
            }
@@ -483,7 +484,7 @@ class Dynamic_Featured_Image {
     */
    public function get_image_title( $image_url ) {

-       return self::execute_query( $this->db->prepare( "SELECT post_title FROM " . $this->prefix . "posts" . " WHERE guid = %s", $image_url ) );
+       return self::execute_query( $this->db->prepare( "SELECT post_title FROM " . $this->prefix . "posts" . " WHERE guid = %s", $image_url ) ); // @todo should use $wpdb->posts and value should be cached

    } // END get_image_title()

@@ -499,7 +500,7 @@ class Dynamic_Featured_Image {
     */
    public function get_image_title_by_id( $attachment_id ) {       

-       return self::execute_query( $this->db->prepare( "SELECT post_title FROM " . $this->prefix . "posts" . " WHERE ID = %d", $attachment_id ) );
+       return self::execute_query( $this->db->prepare( "SELECT post_title FROM " . $this->prefix . "posts" . " WHERE ID = %d", $attachment_id ) ); // @todo should use get_post( $attachnent_id )->post_title since it is cached

    } // END get_image_title_by_id()

@@ -531,7 +532,7 @@ class Dynamic_Featured_Image {
     */
    public function get_image_caption_by_id( $attachment_id ) {

-       return self::execute_query( $this->db->prepare("SELECT post_excerpt FROM " . $this->prefix . "posts" . " WHERE ID = %d", $attachment_id) );
+       return self::execute_query( $this->db->prepare("SELECT post_excerpt FROM " . $this->prefix . "posts" . " WHERE ID = %d", $attachment_id) ); // @todo should use get_post( $attachnent_id )->post_excerpt since it is cached

    } // END get_image_caption_by_id()

@@ -549,7 +550,7 @@ class Dynamic_Featured_Image {
     */
    public function get_image_alt( $image_url ) {

-       $attachment = $this->db->get_col( $this->db->prepare( "SELECT ID FROM " . $this->prefix . "posts" . " WHERE guid = %s", $image_url ) );
+       $attachment = $this->db->get_col( $this->db->prepare( "SELECT ID FROM " . $this->prefix . "posts" . " WHERE guid = %s", $image_url ) ); // @todo should use $wpdb->posts and value should be cached

        $alt = null;
        if ( !empty( $attachment ) ) {
@@ -592,7 +593,7 @@ class Dynamic_Featured_Image {
     */
    public function get_image_description( $image_url ) {

-       return self::execute_query( $this->db->prepare( "SELECT post_content FROM " . $this->prefix . "posts" . " WHERE guid = %s", $image_url ) );
+       return self::execute_query( $this->db->prepare( "SELECT post_content FROM " . $this->prefix . "posts" . " WHERE guid = %s", $image_url ) ); // @todo should use $wpdb->posts and value should be cached

    } // END get_image_description()

@@ -607,8 +608,8 @@ class Dynamic_Featured_Image {
    * @return String
    */
    public function get_image_description_by_id( $attachment_id ) {
-       
-       return self::execute_query( $this->db->prepare( "SELECT post_content FROM " . $this->prefix . "posts" . " WHERE ID = %d", $attachment_id ) );
+
+       return self::execute_query( $this->db->prepare( "SELECT post_content FROM " . $this->prefix . "posts" . " WHERE ID = %d", $attachment_id ) ); // @todo should use get_post( $attachnent_id )->post_content since it is cached

    } // END get_image_description_by_id()

@@ -627,12 +628,12 @@ class Dynamic_Featured_Image {
    public function get_post_attachment_ids( $post_id ) {

        $dfiImages = get_post_custom( $post_id );
-       $dfiImages = ( isset( $dfiImages['dfiFeatured'][0] ) ) ? @array_filter( unserialize( $dfiImages['dfiFeatured'][0] ) ) : array();
+       $dfiImages = ( isset( $dfiImages['dfiFeatured'][0] ) ) ? @array_filter( unserialize( $dfiImages['dfiFeatured'][0] ) ) : array(); // @todo shouldn't be suppressing errors with @

        $retVal = array();
        if ( !empty( $dfiImages ) && is_array( $dfiImages ) ) {
            foreach ( $dfiImages as $dfiImage ) {
-               @list( $dfiImageTrimmed, $dfiImageFull ) = explode( ',', $dfiImage );
+               @list( $dfiImageTrimmed, $dfiImageFull ) = explode( ',', $dfiImage ); // @todo shouldn't be suppressing errors with @

                $retVal[] = $this->get_image_id( $this->upload_url . $dfiImageFull );
            }
@@ -656,7 +657,7 @@ class Dynamic_Featured_Image {
     * @return Array if found, null otherwise
     */
    public function get_nth_featured_image( $position, $post_id = null ) {
-
+   // @todo function is not indented properly
    if ( is_null( $post_id ) ) {
        global $post;
        $post_id = $post->ID;
diff --git a/js/script-dfi.js b/js/script-dfi.js
index ec9973c..254177f 100644
--- a/js/script-dfi.js
+++ b/js/script-dfi.js
@@ -5,6 +5,7 @@
     *
     * Copyright (c) 2013, Ankit Pokhrel <[email protected], http://ankitpokhrel.com.np>
     */
+    // @todo file should be using tabs for indentation; there is inconsistent indentation with spaces

     jQuery(document).ready(function($){
     var current = null; 

Rotator image feature

Hi, do you think is possible to rotate the image all the time when someone refresh the website? Thanks in advance. Regards

Featured image meta box appears on ACF plugin admin pages

I can only speak of this plugin, but maybe this is an issue that comes up with other plugins too. When the Advanced Custom Fields (ACF) plugin is activated the featured image meta box appears underneath the Publish meta box, when editing the custom field settings.

Titles broken after moving to new server

Hi there,

I was tasked with moving a wordpress website from one host to another. I was not the one who set up the site initially and am a bit stumped with an issue with the Dynamic Featured Image plugin.

The complete website functions, but there are no longer any titles on the featured images. I only see "" and when editing the page it only shows the first featured image, the others seem to be there but are not displaying any images.

It's a one-on-one move, so I made a backup of all files and a database dump, then uploaded everything to the new host. The images are there and load on the page, but something seems to be broken with the titles and displaying the images in the edit screen.

One difference is that the page used to be on http://www.esthetisch.nl and is now temporarily located on http://185.56.146.14/~esthetisch/. We only want to move the domainname when we're sure that everything is functioning properly. But this problem is making me wonder if it's a problem with the website technically being in a folder.

image

image

attachment_id is null

Hello!

There seems to be a bug with the output of attachment_id.

Works just fine for the first image, but if I add an additional image, attachment_id is null.
Using the get_image_id with the URL from full supplied also returns null :/

Currently using this work around to get the ID
$attachment_id = attachment_url_to_postid( url_to_full_image.jpg );

functions closely resemble WP Core functions

Your functions, for example "get_post_attachment_ids()" very closely resemble some of the WordPress core functions such as "get_post_thumbnail_id()". Most plugin authors use an acronym in their function name like "dfi_get_post_attachment_ids()" to prevent the possibility that WordPress core might add that function in the future for something else. Just giving you a heads up, you may encounter some issues down the road with your naming conventions.

Missing image attributes in output array

I am trying to create a slider from the multiple featured images, but I also want the meta-fields like alt or title or link to be included in the imagearray which is delivered by get_featured_images(). After having a look at the code, I saw the functions being available but unused. Why is this so?

I have added in line 960 (dynamic-featured-image.php) some lines:

try {
$ret_images[ $count ]['thumb'] = $this->get_real_upload_path( $dfi_image_trimmed );
$ret_images[ $count ]['full'] = $this->get_real_upload_path( $dfi_image_full );
$ret_images[ $count ]['attachment_id'] = $this->get_image_id( $ret_images[ $count ]['full'] );
$ret_images[ $count ]['alt'] = $this->get_image_alt_by_id( $ret_images[ $count ]['attachment_id'] );
$ret_images[ $count ]['description'] = $this->get_image_description_by_id( $ret_images[ $count ]['attachment_id'] );
$ret_images[ $count ]['link'] = $this->get_link_to_image( $ret_images[ $count ]['attachment_id'] );
} catch ( Exception $e ) {
/* Ignore the exception and continue with other featured images */
}

Couldn't this go into the regular code?

featured image not attached after saving post

On wordpress 3.8.1 with plugin version 3.0.0 the added featured image is not saved after updating a post or page.

When clicking add, the media selector comes up and you can select an image.
After selecting one, the image shows in the panel.
After updating the image is removed and $dynamic_featured_image->get_featured_images() returns:
Array ( [0] => Array ( [thumb] => http://<wordpress url>/wp-contentundefined [full] => http://<wordpress url>/wp-contentundefined [attachment_id] => ) )

Warning: Illegal string offset 'post_id' in /plugins/dynamic-featured-image/dynamic-featured-image.php on line 467

I'm getting this error when using the plugin.

Warning: Illegal string offset 'post_id' in /plugins/dynamic-featured-image/dynamic-featured-image.php on line 467

This is my code:

<?php $partners = get_posts('post_type=team_manager&team_groups=partners');
        if ($partners) :
            foreach ($partners as $post): ?>
                <?php 
                if( class_exists('Dynamic_Featured_Image') ) {
                   global $dynamic_featured_image;
                   $featured_images = $dynamic_featured_image->get_featured_images();
                }
                ?>
                <li><a href="<?php echo network_site_url( '/' ); ?>partners"><img src="<?php echo $featured_images[0]['thumb']; ?>" alt=""></a></li>
            <?php endforeach; ?>
<?php endif; ?>

Media selector shows all available files instead of only images

I stumbled across this one while working on a site which uploads a lot of PDF files but also uses this plugin. In these cases it would be great if the media selector dialog would only show image files and filter out all the other. It's really a minor improvement, but it would mirror the behavior of the default WordPress Featured Image field.

Invalid image path returned

Wordpress 4.0 with multisite enabled, plugin version 3.1.13.

Adding a featured image to a post is saving an invalid image path:

Array
(
    [0] => Array
        (
            [thumb] => http://www.example.com/wp-content/uploads/sites/10http://www.example.com/foxglove/wp-content/uploads/sites/10/2014/08/ballroomopiumden044-150x150.jpg
            [full] => http://www.example.com/foxglove/wp-content/uploads/sites/10http://www.example.com/foxglove/wp-content/uploads/sites/10/2014/08/ballroomopiumden044.jpg
            [attachment_id] => 
        )

)

Existing featured images saved to posts are displaying correctly. I'm not sure if the issue started after upgrading Wordpress or the plugin.

Suggestion for "Retrieving data in a theme" page

This page would be even more helpful for beginners if you fleshed out the "/You can now loop through the image to display them as required" sections with more information.

I was left feeling puzzled what to do next...

Thank you :)

Incorrect data return when no image attached!

The data array is incorrect when no image is attached.

Array
(
    [0] => Array
        (
            [thumb] => http://localhost/wp-content/uploads
            [full] => http://localhost/wp-content/uploads
            [attachment_id] =>
        )
)

Can't see any Media in Library with DFI Plugin Installed

I've installed your plugin (Version 3.5.0) on WordPress 4.2.2 and I can no longer see the images in my media library. When uploading I get an error also - 'HTTP error', but the image does upload, it just doesn't show in the media library.

Any ideas?

Thanks.

Image URL Not echoing

if( class_exists('Dynamic_Featured_Image') ) {
global $dynamic_featured_image;
$featured_images = $dynamic_featured_image->get_featured_images( $postId );

foreach ($featured_images as $key => $value) {
    echo "<h1>" .$value. "</h1>";
}
//You can now loop through the image to display them as required

}

after adding this in single.php file only Array echo instead of image URL.

syntax error in dynamic-featured-image.php on line 546

hi, i updated the dynamic featured image. after that errors comes that syntax error, unexpected '[' in plugins/dynamic-featured-image/dynamic-featured-image.php on line 546. please verify that issue. please do rply. i'll waiting for response.
Thanx ๐Ÿ‘

Path is doubling up when retrieving the image urls, what am I doing wrong?

This is the output that I am getting:

Array
(
    [0] => Array
        (
            [thumb] => https://example.com/app/uploadshttp://example.com/app/uploads/2014/07/Creatine_thumb_lg-150x150.jpg
            [full] => https://example.com/app/uploadshttp://example.com/app/uploads/2014/07/Creatine_thumb_lg.jpg
            [attachment_id] => 
        )

    [1] => Array
        (
            [thumb] => https://example.com/app/uploadshttp://example.com/app/uploads/2014/07/Creatine1-150x150.jpg
            [full] => https://example.com/app/uploadshttp://example.com/app/uploads/2014/07/Creatine1.jpg
            [attachment_id] => 
        )

)

Thanks.

Linking from External URL

Great plugin! but when trying to set an image from URL, WP doesn't store it if it is not in the same server as WP files. Could you do anything about it? Thx in advance!

Issue with dynamic-featured-image-settings plugin

Your dynamic-featured-image-settings/js/scripts-dfis-frontend.js is calling .fancybox() and .slick() without actually checking if the element exists.

Suggestion:

if( jQuery().fancybox && $('.fancybox').length ) {

and

if( jQuery().slick && $('.dfiSliderSync').length ) {

Lastly, what is this being used for?

Save attachment ID instead of attachment URLs

I'm curious, was there any good reason why you're saving the attachment URLs (full and thumb) instead of their post IDs? We may need to display other sizes on the front-end, and that wouldn't be easy without knowing the attachment IDs.

Support for Woocommerce

if( function_exists('dfiDisplayFeaturedImages') ){
dfiDisplayFeaturedImages();
}

...and the other piece of code you supplied for theme support don't work. Do you have an action written which I could just insert into my functions.php?

Errors after update and documentation

Hello, I've recently updated my plugin and am now getting the error:

Fatal error: Call to a member function get_featured_images() on a non-object in /var/www/vhosts/20dogsinabowl.com/httpdocs/wp-content/themes/twentyfourteen/about.php on line 48

On this code:

  Line 48<h6><?php echo dfi_get_image_title( $featuredImages[0]["full"] ); ?> <br /> <span><?php echo dfi_get_image_caption( $featuredImages[0]["full"] );?></span></h6>    

<div class="circle-div-by-hv"><img src="<?php echo $featuredImages[0]["full"]; ?>" alt="" /></div>

Can you help me understand how to get the 3 featured images from $Dynamic_Featured_Image->get_featured_images($id); and their title/caption info in version 3.0? Thank you.

featured image not always visible in backend

I have found out that images in the dynamic featured image box are not always visible in the backend although they all show up at the frontend.

One scenario is if you add an image trough the dynamic featured image box that is already in the media-library and has been uploaded to another post or page (visible in the list view of the Media Library, column 'Uploaded to'). After you save your page or post it's not in the box anymore.

Another scenario in which the image does not show up in the backend box is when you upload a new image through a dynamic featured image box, edit the image (rotate, crop, etc.) and then attach it, choosing it from the media library again. Save the post or page to see the empty box.

I used WP 3.9.1 without any other plugins activated, TwentyTwelve theme and dyn-feat-img plugin version 3.0.1 on OSX 10.9.2, PHP 5.4.24, MySQL 5.0.10. I experienced the same behavior on live servers with Linux

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.