WordPress.org

Support

Support » Plugins and Hacks » upprev custom field image

upprev custom field image

Viewing 15 replies - 1 through 15 (of 17 total)
  • Plugin Author Marcin Pietrzak
    Participant

    @iworks

    1. Get Development Version
    2. If theme support post-thumbnail feature and post have a image, then You can filter this by “iworks_upprev_get_the_post_thumbnail”.
    3. Other way You can use action “iworks_upprev_image”

    action:

    <?php
    
    add_action( 'iworks_upprev_image', 'my_image' );
    function my_image()
    {
    // code to get image, then:
        echo '<img src="....'>;
    }

    Hi Marcin,

    Thank you for your response,
    shoul i use iworks_upprev_get_the_post_thumbnail instead of get_the_post_thumbnail?
    for solution 3 where should i add the code ?

    i found a interesting solution as a newbie on php;
    can you check this ?
    i changed get thubnail to get_post_meta but this time thumbnail array dont work so i add width and height manually, and only the part /wpcontent/gallery/… parts display,
    so i added my site adress manually instead of get_bloginfo(‘template_directory’), cause i dont know how to code ­čÖü

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Plugin Author Marcin Pietrzak
    Participant

    @iworks

    Please paste code to pastebin.

    sorry , here is link;
    http://pastebin.com/ztj1Gfxk

    Plugin Author Marcin Pietrzak
    Participant

    @iworks

    Of course you can modify plugin the source, but this is bad idea at all.
    Instead try use filter or action, to change image.

    how can i do it ? with solution on your first reply?
    i dont understand what you mean with 2nd and 3rd option, can you explain ?

    If theme support post-thumbnail feature and post have a image, then You can filter this by “iworks_upprev_get_the_post_thumbnail”.
    Other way You can use action “iworks_upprev_image”

    Plugin Author Marcin Pietrzak
    Participant

    @iworks

    this is too much for me ­čÖü
    i hope you can add this option to future versions..

    This is great plug-in, i can show more than 1 post and there is many other options,
    i have removed simplereach plugin and installed upprevs to my sites,
    thank you again!

    Plugin Author Marcin Pietrzak
    Participant

    @iworks

    i hope you can add this option to future versions..

    I think, I dont’ do it, because using custom field name “image” instead build-in featured image is a very wrong way.

    mgmiter
    Member

    @mgmiter

    hej Marcin,

    od┼Ťwie┼╝─Ö w─ůtek bo mnie zaciekawi┼é. Chcia┼ébym ┼╝eby w ramach ikonki kolo wpisu pojawia┼éo mi si─Ö zdj─Öcie z posta a nie “thumbnail” bo nie korzystam z tego. jest taka mo┼╝liwo┼Ť─ç

    Plugin Author Marcin Pietrzak
    Participant

    @iworks

    od┼Ťwie┼╝─Ö w─ůtek bo mnie zaciekawi┼é. Chcia┼ébym ┼╝eby w ramach ikonki kolo wpisu pojawia┼éo mi si─Ö zdj─Öcie z posta a nie “thumbnail” bo nie korzystam z tego. jest taka mo┼╝liwo┼Ť─ç

    Use filter iworks_upprev_get_the_post_thumbnail to replace default thumbnail to other, choose by You image. It could by anything.

    And use iworks_upprev_image action to add image to post without thumbnails.

    add_filter( 'iworks_upprev_get_the_post_thumbnail', 'foo' );
    add_action( 'iworks_upprev_image', 'foo' );
    function foo( $image )
    {
        return '<img src="/wp-includes/images/arrow-pointer-blue.png" />';
    }
    mgmiter
    Member

    @mgmiter

    where I must write this code? in plugin editor?

    Plugin Author Marcin Pietrzak
    Participant

    @iworks

    where I must write this code? in plugin editor?

    Create a plugin or mu-plugin or add to function.php of used theme.

    mgmiter
    Member

    @mgmiter

    Marcin,
    tak pomagasz jakby┼Ť nie pomaga┼é. Skoro zadaje pytanie to znaczy ┼╝e nie wiem jak to zrobi─ç. Jak nie chcesz powiedzie─ç to nie m├│w, a takie has┼éowe odpowiedzi to i tak nic nie zmieniaj─ů a tylko zniech─Öcaj─ů jak i mojego poprzednika z w─ůtku.

    Plugin Author Marcin Pietrzak
    Participant

    @iworks

    tak pomagasz jakby┼Ť nie pomaga┼é. Skoro zadaje pytanie to znaczy ┼╝e nie wiem jak to zrobi─ç. Jak nie chcesz powiedzie─ç to nie m├│w, a takie has┼éowe odpowiedzi to i tak nic nie zmieniaj─ů a tylko zniech─Öcaj─ů jak i mojego poprzednika z w─ůtku.

    Odpowiedź jest dokładna i precyzyjna. Dodaj kod do plik functions.php używanego motywu. Co jest w tym niezrozumiałego?

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘upprev custom field image’ is closed to new replies.