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

    (@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="....'>;
    }
    Thread Starter swordof

    (@swordof)

    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

    (@iworks)

    Please paste code to pastebin.

    Thread Starter swordof

    (@swordof)

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

    Plugin Author Marcin Pietrzak

    (@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.

    Thread Starter swordof

    (@swordof)

    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

    (@iworks)

    Thread Starter swordof

    (@swordof)

    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

    (@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.

    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

    (@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" />';
    }

    where I must write this code? in plugin editor?

    Plugin Author Marcin Pietrzak

    (@iworks)

    where I must write this code? in plugin editor?

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

    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

    (@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.