Inline linking to download

Viewing 3 posts - 1 through 3 (of 3 total)
#121737

Kris Sinnaeve
Participant

I’m new on this forum. I couldn’t find an answer to my question here so I’m launching a new thread.

I’d like to link to a download package in running text.
I’ve created a link-template-url.php file with the following contents:
<a href="[download_url]" rel='nofollow'>[title]</a>

Function wise this has the expected result, but visually it’s not displayed in running text but as a separate div.
For some (for me yet unknown) reason this code is surrounded by a <div class=”w3eden”>.
Is it possible to suppress this <div>?

#121775

Nayeem Riddhi
Moderator

Hi,

Are you missing something CSS related issue in frontend in the link-template? Please let me know.

Thanks.

#121780

Kris Sinnaeve
Participant

It’s not CSS related, but the fact the <div class="w3eden"> is added.
Some threads here point me to a possible solution (see https://www.wpdownloadmanager.com/support/topic/custom-link-template-3/, https://www.wpdownloadmanager.com/support/topic/w3eden-div-is-forcing-link-to-a-new-line/ and https://www.wpdownloadmanager.com/support/topic/remove-the-w3eden-div-2/) where the last one sounds the most promising one:

You can use simple jquery with the theme to remove the div with the class name. But you need to run the code only for the page you want to hide the div.

var title = $(".w3eden").contents();
$(".w3eden").replaceWith(title);

Thanks

Applying the suggestion above, I added the following line in my scripts.js file:
$("div.w3eden").contents().unwrap();
but WordPress automatically adds </p> and <p> tags around the shortcode. https://wp-mix.com/wordpress-disable-extra-p-tags-shortcodes/ seems to tackle this but I wasn’t able to achieve this yet.

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Inline linking to download’ is closed to new replies.