Skip Navigation

[Resolved] I need to do with this line is NOT display it at all if there is NO Author credit

This support ticket is created 5 years, 4 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.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 15 replies, has 3 voices.

Last updated by Minesh 5 years, 4 months ago.

Assisted by: Minesh.

Author
Posts
#1295545

Luo that is great...I've had a look through that and 'think' I understand.

The only thing I need to do with this line is NOT display it at all if there is NO Author credit. This is something to do with an IF statement I think but again I don't know what and where to put it - in the View, in Elementor?

As you can see Luo I am very new to doing this, loads to learn, and really do appreciate your help. Are you available to hire? 🙂

Thanks

John

#1295549

I have tried this in the elementor shortcode but it doesn't display the line

[wpv-conditional if="( (empty($(wpcf-author-credit))) )"][types field='author-credit'][/types][wpv-view name="production-authors"][/wpv-conditional]

I have tried this, adding the NOT, but this just displays the short code itself

[wpv-conditional if="( NOT(empty($(wpcf-author-credit))) )"][types field='author-credit'][/types][wpv-view name="production-authors"][/wpv-conditional]

I am trying! 🙂

#1295563

Dear John,

Yes, you are right, it needs [wpv-conditional] shortcodes, and your codes are correct.

As you can see the [wpv-conditional shortcodes does not work as expected insider elementor shortcode widget.

As a workaround, I suggest you try these:
1) Create a content template "by author CT":
hidden link
Copy the same codes you mentioned above in it's content:

[wpv-conditional if="( NOT (empty($(wpcf-author-credit))) )"][types field='author-credit'][/types][wpv-view name="production-authors"][/wpv-conditional]

2) Put above content template shortcode into elementor shortcode widget:
hidden link
[wpv-post-body view_template="by author CT"]

Please check if it is fixed. thanks

#1295599

Update:
Above workaround won't work as expected in your website, I suggest you replace the shortcode widget with a text widget, with the same codes:

[wpv-conditional if="( NOT (empty($(wpcf-author-credit))) )"][types field='author-credit'][/types][wpv-view name="production-authors"][/wpv-conditional]

See it here:
hidden link

And it is only a demo, you will need to customize it with CSS style according to your website settings.

#1295665

I still can't get this to work 🙁

The original code I did had (wpcf-author-credit) when I think it should be just (wpcf-author) as I only want the author line to display IF the Author is NOT empty. If it IS empty the no line should display.

I know conditional shortcodes DO work on this template as in the BLUE bar under the image there is a 'warning' conditional as follows:

[wpv-conditional if="( NOT(empty($(wpcf-warning))) )"]

<a class="warning" href="<em><u>hidden link</u></em>" title="Find out more about our production selection and why sometimes we need to have this warning"><p class="warning">[types field='warning'][/types]</p><span style="font-size:80%; color:#fff;"> ( find our more )</span></a></div>
			
[/wpv-conditional]

This works fine.

Might this be something to do with the productions-authors relationship?

#1295785

Please elaborate the question with more details:
How do you setup the field "wpcf-author"? registered to which post type?

#1295893

Another quick video so you can see what I need.

hidden link

Thanks

Luo

#1297609

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Luo is on vacation. This is Minesh here and I'll take care of this ticket. Hope this is OK.

The video you shared do not have any voice so I hardly understand anything.

What if you share problem URL and access details and explain a bit more that what exactly you want to display with author conditionally as well as what is your expected results. That will help me to understand your issue as well as guide you in the right direction.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1297661

Hi Minesh

I have redone the video so you can see...and HEAR...this problem.

hidden link (its 2 mins)

Many thanks
---
John

#1298359

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I checked the video but still, there is no voice. Can you please just tell me what field you want to compare and what is your expected output and problem URL. Maybe few screenshots will help as well.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1298407

Sorry about this Minesh.

On the Elementor Template 'Productions - Main' there is a section that displays the 'Author's Credit' then the 'Author's name'. eg. By Author Miller

I do not want this to display IF the Authors name is not there.

IF statements DO work in Elementor Pro as you will see from the orange text section "WARNING NOT EMPTY"

Author's Name comes for the Custom Type 'Author' (Post Title)

There is a relationship between Productions and Authors

Hope that's OK for you.
---
John

#1298453

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

So for instance, with this post: hidden link

It is showing "no items found" - you wanted to display nothing there instead of "no items found" - correct?

#1298465

Good example Minesh but no...I have just removed the "no items found" from the 'View' but it is still displays the 'Author Credit' By

Of course, I can remove the author credit from the Production and this WILL do the job however I am trying to 'User Proof' the system. I cannot guarantee that 'Users' will NOT add this 'Authors Credit' when adding a production. That's why I wantd to use a IF "Author's Name is NOT empty" SHOW this elementor Shortcode/Element

Thanks
---
John

#1298477

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

So basically if there is no author connected with production post you do not wanted to display the "By" text that is coming from the custom field "Author Credit" - do I understand correctly now?

#1298521

That is correct