upprev custom field image
-
hello,
is there any way to use upprev with custom field image, my theme use custom field “image” instead of featured image, can i show this field as tubnail on upprev ?
-
- Get Development Version
- 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”
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]
Please paste code to pastebin.
sorry , here is link;
http://pastebin.com/ztj1GfxkOf 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”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!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ść
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_thumbnailto replace default thumbnail to other, choose by You image. It could by anything.And use
iworks_upprev_imageaction 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?
where I must write this code? in plugin editor?
Create a plugin or mu-plugin or add to
function.phpof 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.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.phpużywanego motywu. Co jest w tym niezrozumiałego?
The topic ‘upprev custom field image’ is closed to new replies.