M
M
Mr__Twister2015-01-27 18:55:00
User interface
Mr__Twister, 2015-01-27 18:55:00

How to replace menu link with plain text in WordPress?

I'm making a theme in WordPress. I want to ensure that the pages do not refer to themselves in the main menu. Relatively speaking:

  • First section
  • Second section
  • Third section
  • Fourth section

after moving to the second section:
  • First section
  • Second section
  • Third section
  • Fourth section

It is important to remove the link from this paragraph, and not visually hide it. Are there WordPress plugins for this kind of needs? If not, how can this be achieved?
A detailed description of this ideology: ilyabirman.ru/meanwhile/all/website-menu-item-states

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mr__Twister, 2015-01-28
@Mr__Twister

I found a solution that consists in replacing the navigation output function. Everything is described here: omurashov.ru/wordpress-remove-link-to-current-page...
After that, the styles fly off a little, you will need to make a couple of edits to the CSS, but everything works like that.

A
Alexander Vitkalov, 2015-01-27
@nechin

I'm not 100% sure because I can't check the code. But I would try something like this:

function my_wp_head() {
    if (/*это второй раздел*/)
    echo "<script>
                    /*Заменить ссылку на текст*/;
                </script>";
}
add_action('wp_head', 'my_wp_head');

I think there will be no problem to check and insert the replacement script on the same jQuery. Otherwise you would be asking a different question.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question