Skip Navigation

[Résolu] Adding placeholder images in custom search output

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created Il y a 9 années et 7 mois. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 -
- - - - - - -

Supporter timezone: Europe/Madrid (GMT+01:00)

This topic contains 13 réponses, has 3 voix.

Last updated by A. Ku Il y a 9 années et 7 mois.

Assisted by: Caridad.

Auteur
Publications
#237399

Hi there - I am trying to add a custom image as a placeholder in a the search section if there is not a featured post for the returned search item. I am aware some use of "if" statements will get me there but cannot seem to get it up and running. Presently my search code has <a href="[wpv-post-url]">[wpv-post-featured-image]</a> for the image. In the instance there is no image I would like to have a standard <img src-"picture url"> to replace the [wpv-post-featured-image]

How would this be accomplished?

Thanks so much!!

#237442

Dear James,

You should be able to use something like this:

<a href="[wpv-post-url]??>
  [wpv-if evaluate="'[wpv-post-featured-image]' = ''"]
  <img src="default.png" />
  [wpv-if]
  [wpv-post-featured-image]
</a>

Don’t forget to adjust the path to the default image.

Please let me know if you are satisfied with my reply and any other questions you may have.

Regards
Caridad

#237598

Hi there - thanks!

I put this code in:

<a href=“[wpv-post-url]??>[wpv-if evaluate="'[wpv-post-featured-image]' = ''"]<img src="hidden link" width="200" height="113" />[wpv-if][wpv-post-featured-image]</a>

It ended up showing both the placeholder and the featured image, not one or the other. Any thoughts?

Thanks again

#237736

Dear James,

I’m seeing the same problem but this should be working. Can you try update to todays releases of Toolset plugins? You need to update all Toolset plugins together. If the problem persists, I will report it to the developers for fixing.

Please let me know if you are satisfied with my reply and any other questions you may have.

Regards
Caridad

#238636

Thanks for the advice. I updated and the issue is persisting.

#239131

Hi there. To confirm, I had not seen the types update so have also updated that and the issue continues. I hope this helps, cheers!

#239439

Dear James,

I will report this to the developers for fixing. I will get back to you when I have more information.

Regards,
Caridad

#241148

Dear James,

There was a typo in my code, I wasn't closing the wpv-if shortcode correctly.

Try with this instead:

<a href="[wpv-post-url]">
  [wpv-if evaluate="'[wpv-post-featured-image]' = ''"]
  <img src="default.png" />
  [/wpv-if]
  [wpv-post-featured-image]
</a>

Regards
Caridad

#241401

Thanks for sticking at this! It is not presently giving any placeholder image with this at this point. I am using the following code:

<a href="[wpv-post-url]">
[wpv-if evaluate="'[wpv-post-featured-image]' = ''"]
<img src="hidden link" />
[/wpv-if]
[wpv-post-featured-image]
</a>

And this is my search page:

hidden link

Thanks!!

#242090

Dear James,

I tested this local and it was working. Can you share access to your Dashboard so I can review whats wrong?

Thanks
Caridad

#242301

Sure thing, thanks!!

#242579

Dear James

I was able to get it working with the following code:

  [wpv-if evaluate="'[wpv-post-featured-image data="id"]' = ''"]
  <img src="/wp-content/uploads/2014/08/featured-image-place.jpg" />
  [/wpv-if]
  [wpv-post-featured-image]

Let me know if you are satisfied with my reply and any other questions you may have.

Regards,
Caridad

#242729

That is fantastic, thank you so much for all of the help!

#500710

Thanks, was looking for this.

Le forum ‘Types Community Support’ est fermé à de nouveaux sujets et réponses.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.