Skip Navigation

[Resolved] Conditional only working for some posts

This support ticket is created 4 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 1 reply, has 1 voice.

Last updated by matthewC-9 4 years, 10 months ago.

Author
Posts
#1417035

I have a view that's a list of technologies. I'm trying to set it up so that if there's a custom excerpt, the technology name is linked, and if not, it isn't.

I set up a function to create a shortcode to check for an actual excerpt (instead of a generated excerpt) based on the advice here: https://toolset.com/forums/topic/show-post-excerpt-if-not-empty-otherwise-show-post-body/.

Here's my view:

  [wpv-conditional if="('[wpv-post-real-excerpt]' != '')"]
    <h2>[wpv-post-link]</h2>
  [/wpv-conditional]
  [wpv-conditional if="('[wpv-post-real-excerpt]' eq '')"]
    <h2>[wpv-post-title]</h2>
  [/wpv-conditional]

  [wpv-post-link]
  <br>
  [wpv-post-excerpt]

I expected to see: each technology has a header either with or without a link.

Instead, I got: only the more recently created technologies have any kind of header. (But editing and re-saving one of the older ones did not make the header show up.) Some of each type do work - see "Public internet access computers" and "Fax machine."

Link to a page where the issue can be seen: hidden link

#1417039

OK, interestingly, deleting and re-adding the excerpts seems to be fixing the older posts. Not sure why, but I'll take it.