Skip Navigation

[Resolved] PDF Link not working

This thread is resolved. Here is a description of the problem and solution.

Problem:

I used shortcode to add a PDF link but it is not working.

Solution:

As you have shortcode inside the HTML code, you need to make sure that the quotes and double-quotes are added correctly.

Use single quotes for the shortcode attributes and double-quotes for HTML attributes.

Example:

<a href = "[types field = 'brochure-pdf' target = '_new' output = 'raw'][/types]" style="color: #292D6D">DOWNLOAD THE BROCHURE</a>
This support ticket is created 2 years, 3 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 5 replies, has 2 voices.

Last updated by belindaV 2 years, 3 months ago.

Assisted by: Christopher Amirian.

Author
Posts
#2486785
Screenshot 2022-11-01 at 11.51.47.png
Screenshot 2022-11-01 at 11.48.27.png

Tell us what you are trying to do?

PROBLEM ONE:
I have two content templates that I created in the block editor and one of the fields is supposed to link to a PDF that gets uploaded in the post type. I have this as my "code"

DOWNLOAD THE BROCHURE

This is not working though at all - it opens to a blank page even when I know there is a PDF connected to it.

PROBLEM TWO:
I have an odd white space at the bottom of my content template and when I try to remove it via CSS it messes up the entire top section of my layout.

Is there any documentation that you are following? No

Is there a similar example that we can see? No

What is the link to your site?
URL: thankful-scissors.localsite.io
URL to page with issues: hidden link
UN to view the site: theatre
PW to view the site: slippery

#2486851

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

I checked the link and I see that it is generated like this:

hidden link

This shows that you missed a correct quote and double-quote combination.

Please change the code to:

<a href = "[types field = 'brochure-pdf' target = '_new' output = 'raw'][/types]" style="color: #292D6D">DOWNLOAD THE BROCHURE</a>

See if it works for you and compare it with the code that you mentioned in the ticket.

Would you please share a screenshot of the white space that you have mentioned for the second problem? I can not see it in the front end.

Would you please check with another browser?

Also please try to change the theme to see if it is related to your theme or not:

- IMPORTANT STEP! Create a backup of your website.
- Switch to the default theme such as "TwentyTwenty" by going to "WordPress Dashboard > Appearance > themes".
- See if the issue is fixed.

Thanks.

#2486909
Empty-Space.jpg

Thanks so much - the PDF is now working.

The empty space is at the bottom of the contact form just before the newsletter subscription section. I have looked at it in Chrome, Safari and Photoshop and I can still see the white space in all browsers.

I have tried switching my theme but the gap still remains for some reason.

hidden link

#2487413

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

I am glad that the PDF issue is fixed.

As I do not have access to the admin I am not sure which block you use, but I see in the HTML code that there is a wp-container one that has margins. So each container block that you add has a margin.

Most probably the block that you use have an option to set the margin to 0.

Alternatively, you can use the Toolset Grid block for the layout and it has options to set the margin.

For more information:

https://toolset.com/course-lesson/responsive-columns-and-grids/

Thanks.

#2487673
Screenshot 2022-11-02 at 12.47.51.png

I have added this in CSS which gets rid of the white gap but it messes up the top section of the layout.

.wp-block-columns {
margin-bottom: 0em !important;
}

Instead of the two columns being next to each other, the one column is now underneath the other one - and all I did was remove the margin...

#2487683

My issue is resolved now. Thank you!