Last active
November 4, 2021 12:10
-
-
Save seojacky/79adea6c27948eb7f3845ca1c80e0536 to your computer and use it in GitHub Desktop.
button-like-link.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Эта функция добавляет в стандартное меню новый пункт | |
function add_last_nav_item($items) { | |
$items .= '<button class="btn_link" onclick="window.open(https://miracle-workers.ru/contact/);">Контакты</button>'; | |
// $items .= '<form action="https://miracle-workers.ru/contact/"><button type="submit">Контакты</form>'; //другой вариант, без джс | |
//$items .= '<li>'.get_search_form(false) . '</li>'; //добавляем поиск | |
return $items; | |
} | |
add_filter('wp_nav_menu_items','add_last_nav_item'); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment