There is a menu, and one element is added to it using the script, and the unnecessary is deleted.
There are no problems with adding an item, but there are difficulties with deleting.
The menu from the WordPress is horizontal, I added a page, and it adds an item with a link to the page, I removed the title, but still the menu moved slightly. How to create a page without adding to the menu, I do not know, or rather the methods I know are not satisfied, so I want to remove the script.
<script type="text/javascript" language="javascript"> $(document).ready(function(){ //удаляем "ненужное"(не работает) $(".page_item page-item-716").remove(); //добавляем первый пункт в блок ul $('<li><a href="#">Добавили скриптом</a></li>').prependTo('.menu > ul'); }); </script> <div class="menu"> <ul> <li><a href="#">Добавили скриптом</a></li> <li class="page_item page-item-2"><a href="#" title="р1">р1</a></li> <li class="page_item page-item-17"><a href="#" title="р2">р2</a></li> <li class="page_item page-item-89"><a href="#" title="р3">р3</a></li> <li class="page_item page-item-91"><a href="#" title="р4">р4</a></li> <li class="page_item page-item-716"><a href="#" title="">вот этот пункт вместе с ли надо вообще удалить, но не получается </a></li> </ul></div> UPD
remove () - works quite well. I think the problem is in the class name with a space, how can I get around this? (removing the space is not an option)