Forum Replies Created
-
AuthorPosts
-
iloop19
ParticipantYou cannot access this content.
iloop19
ParticipantYou cannot access this content.
iloop19
Participantgreat great great !
thanksiloop19
ParticipantHi,
Ok i understand the problem, so if i choose no to group results, could it be possible to display the taxonomy field under or above the title field of each result ?
thanks
iloop19
Participantthanks a lot !!
iloop19
Participantplease what do you think of the code , could it be better ?
thanksiloop19
Participantthis is very not elegant but working:
if ( isset($field[0])) {$r->image = $field[0];}
if ($field[0]==”h”) {$r->image = $field;}iloop19
ParticipantThe code below works ! but now i don’t have image that are not in a sub array.
not OK:
[image] => https://entreprises-uzes-pontdugard.fr/wp-content/uploads/listing-uploads/logo/2020/07/Logo-A2CP-web.jpg
OK:
[image] => Array
(
[0] => https://entreprises-uzes-pontdugard.fr/wp-content/uploads/listing-uploads/logo/2020/02/cartouche_blc.png
)add_filter( ‘asp_results’, ‘asp_custom_image_results’, 10, 1 );
function asp_custom_image_results( $results ) {
$field_name = ‘_job_logo’;
foreach ($results as $k=>&$r) {
$field = get_post_meta( $r->id, $field_name , true );
if ( isset($field[0])) {$r->image = $field[0];} }return $results;
}iloop19
ParticipantNOpe…
It seems this return false so it does no enter in the condition
if ( $r->content_type == ‘pagepost’ && empty($r->image) )iloop19
Participantso we have either this:
either with an array:
[image] => Array
(
[0] => https://entreprises-uzes-pontdugard.fr/wp-content/uploads/listing-uploads/logo/2020/02/cartouche_blc.png
)iloop19
Participantand this is for post that works (when _job_logo is not serialized)
Array
(
[0] => stdClass Object
(
[title] => SARL A2CP
[post_title] => SARL A2CP
[id] => 7079
[blogid] => 1
[date] => 2020-07-01 11:39:22
[post_date] => 2020-07-01 11:39:22
[content] => Société réalisation les diagnostics immobiliers réglementaires dans le cadre de la vente et de la location, diagnostics amiante…
[excerpt] =>
[post_type] => job_listing
[content_type] => pagepost
[g_content_type] => post_page_cpt
[author] => a2cp
[post_author] => 1214
[priority] => 100
[p_type_priority] => 1
[group_priority] => 1
[relevance] => 1
[customfp] => 1
[customfs] => 1
[image] => https://entreprises-uzes-pontdugard.fr/wp-content/uploads/listing-uploads/logo/2020/07/Logo-A2CP-web.jpg
[link] => https://entreprises-uzes-pontdugard.fr/entreprise/sarl-a2cp/
)[1] => stdClass Object
(
[title] => CAP VITAL SANTÉ DE L’UZÈGE
[post_title] => CAP VITAL SANTÉ DE L’UZÈGE
[id] => 2872
[blogid] => 1
[date] => 2020-06-30 14:17:36
[post_date] => 2020-06-30 14:17:36
[content] => Vente et location de matériel médical – Particuliers, Professionnels, Collectivités.Orthopédie de série et sur…
[excerpt] =>
[post_type] => job_listing
[content_type] => pagepost
[g_content_type] => post_page_cpt
[author] => [email protected]
[post_author] => 50
[priority] => 100
[p_type_priority] => 1
[group_priority] => 1
[relevance] => 1
[customfp] => 1
[customfs] => 1
[image] => https://entreprises-uzes-pontdugard.fr/wp-content/uploads/listing-uploads/logo/2020/06/LOGO-CV-1.jpg
[link] => https://entreprises-uzes-pontdugard.fr/entreprise/cap-vital-sante-de-luzege/
)iloop19
Participanti can prepare you that but this is what is returned in $results:
Array
(
[0] => stdClass Object
(
[title] => JUSTINE LABESSE
[post_title] => JUSTINE LABESSE
[id] => 2908
[blogid] => 1
[date] => 2018-09-07 08:26:08
[post_date] => 2018-09-07 08:26:08
[content] => Conceptrice-rédactrice et consultante marketing.Vous faire exister et grandir dans le coeur de vos clients !
J’aide les…
[excerpt] =>
[post_type] => job_listing
[content_type] => pagepost
[g_content_type] => post_page_cpt
[author] => hello
[post_author] => 26
[priority] => 100
[p_type_priority] => 1
[group_priority] => 1
[relevance] => 20
[customfp] => 1
[customfs] => 1
[image] => Array
(
[0] => https://entreprises-uzes-pontdugard.fr/wp-content/uploads/listing-uploads/logo/2020/02/cartouche_blc.png
)[link] => https://entreprises-uzes-pontdugard.fr/entreprise/justine-labesse/
))
iloop19
ParticipantHi,
Thanks a lot for your code unfortunately i can’t make it work.
My field is _job_logo, but the thumb does not appear.
Best regards,
-
AuthorPosts