Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

If I comment out standard text <!-- hide this text --> it works fine. But if I comment out a link

<!-- <a href="http://www.andrewruis.com/wp-content/uploads/2011/12/EatingtoLearnLearningtoEat.pdf" target="_blank">Download</a> (pdf) --> 

everything below it disappears! I can comment out the text inside the link and that will work. Any ideas on how to fix this? This is the page I've been playing with, but it happens on both pages and posts, with and without passwords: http://www.andrewruis.com/publication/

share|improve this question
I don't think example link relevant anymore? Have you tried some browser tool like Firebug to see what is going on? – Rarst Oct 14 '12 at 20:34

closed as too localized by toscho Nov 4 '12 at 17:04

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.

1 Answer

I trust you are editing in a PHP file? If so try this:

<?php/*
    <a href="...." target="_blank">Download</a> (pdf)
*/?>

The PHP comment should remove it from the DOM as well, therefore will only be visible to the direct editor of the file i.e. you.

share|improve this answer
nope, this is in the HTML area of a WordPress page. Tried the code above but the /?> was visible on the page (though the <?php/ wasn't). – ERM Oct 5 '12 at 18:11
Bear in mind it should be <?php /* and */?>. Remember to include the asterix each time (*). – carmat Oct 6 '12 at 21:54
Yep, that's what I have and this is how it looks on the front-end: Download (pdf) */?> – ERM Oct 8 '12 at 16:25

Not the answer you're looking for? Browse other questions tagged or ask your own question.