Skip Navigation

[Resolved] wpv-post-title not outputting correctly

This support ticket is created 4 years, 1 month 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Karachi (GMT+05:00)

This topic contains 4 replies, has 2 voices.

Last updated by Waqar 4 years ago.

Assisted by: Waqar.

Author
Posts
#1529305

Hello,

I am using the [wpv-post-title] to pull the title and insert into another shortcode like this:

[wps_products tag="[wpv-post-title output="sanitize"]" connective="and" excludes="description, buy-button" show_price_range="false" show_compare_at="true" show_featured_only="true" infinite_scroll="true" align_height="true" ]

It works for anything without special characters like:
Big Star
hidden link

Outputs the products at bottom of page correctly, however this will not work:
BOOKER T & THE M.G.’S
hidden link

I tried adding output="sanitize" to no effect.

#1530487

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Chris,

Thank you for contacting us and I'd be happy to assist.

To troubleshoot and suggest the best way forward, I'll need to see exactly how and where this shortcode is being used.

Can you please share temporary admin login details, in reply to this message?

Note: Your next reply will be private and please make a complete backup copy, before sharing the access details.

regards,
Waqar

#1535299

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for sharing the admin access.

During troubleshooting, I noticed that the Toolset's shortcodes [wpv-post-title] and [wpv-post-title output="sanitize"] both output the post title correctly as: Booker T & the M.G.’s

And if the same title is used in the "tag" attribute, it shows the products correctly:


[wps_products tag="Booker T & the M.G.'s" connective="and" excludes="description, buy-button" show_price_range="false" show_compare_at="true" show_featured_only="true" infinite_scroll="true" align_height="true" ]

Screenshot: hidden link

This suggests that "WP Shopify Pro" doesn't have any issue with the apostrophe or other special characters in the tag attribute, but this is related to how that shortcode is processed as a whole.

I'll recommend getting in touch with that plugin's support team, to see if tag's slug can be used with "wps_products" shortcode in place of the tag's title, which will allow you to replace "wpv-post-title" with "wpv-post-slug".

I hope this helps and please let me know if you need any further assistance around this.

#1535841

The code works fine for all artists names except those with & in them:
Booker T. & The M.G.'S
Nathaniel Rateliff & The Night Sweats

If I change it to "wpv-post-slug" it also works with the exception of the & symbol. So not sure what to do, seems neither app has an issue until the & symbol shows up.

For now I went back to the hard coding like this:

[wps_products tag="Booker T. & The M.G.'S" connective="and" excludes="description, buy-button" show_price_range="false" show_compare_at="true" available_for_sale="available" show_featured_only="true" infinite_scroll="true" align_height="true"]

Let me know if you have any other ideas.

Thanks

#1537051

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thanks for writing back.

Since the "WP Shopify Pro" connects with the product data stored at Shopify and not at WordPress itself, I'm afraid, there isn't much Toolset plugins can do with that data.

I'll recommend checking in your Shopify account how the tag titles and slugs are saved when the "&" symbol is present. You can then create a custom shortcode, which gets the post's title or slug and then returns the output converting or removing the & character from it, accordingly.

Another workaround can be to use "and" instead of "&" character in your product tags and post titles.

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