Answer the question
In order to leave comments, you need to log in
How to remove a link to a page while on this page?
I need to make it so that links to myself should be inactive while on this page.
That is, on my website of dentistry (wordpress) there is a menu that is displayed in a cycle. It is necessary to somehow set a condition so that instead of a link to the page on which we are (for example: dental treatment), just text is displayed. What are the solutions?
Answer the question
In order to leave comments, you need to log in
Cling code example, many ways
if ($alias == trim('/', $_SERVER['REQUEST_URI'])) {
echo "<li>Активный пункт</li>"
} else {
echo "<li><a href=".$alias.">Ссыль</a></li>"
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question