tech

Sydney theme mods: login / logout in header, search in menu

sudo vim /var/www/html/bernhard.hensler.net/wp-content/themes/sydney/functions.php
/**
* Menu fallback
 */

add_filter('wp_nav_menu_items', 'add_login_logout_link', 10, 2); function add_login_logout_link($items, $args) {         ob_start();         wp_loginout('index.php');         $loginoutlink = ob_get_contents();         ob_end_clean();         $items .= '<li>'. $loginoutlink .'</li>';     return $items; }
sudo vim /var/www/html/bernhard.hensler.net/wp-includes/general-template.php 
if ( ! is_user_logged_in() ) {
                $link = '<a href="' . esc_url( wp_login_url( $redirect ) ) . '">' . __( 'login' ) . '</a>';
        } else {
                $link = '<a href="' . esc_url( wp_logout_url( $redirect ) ) . '">' . __( 'logout' ) . '</a>';

add search to navigation header

sudo vim /var/www/html/bernhard.hensler.net/wp-content/themes/sydney/style.css

    .select2-container--default .select2-selection--single,
    select,
    textarea,
    input[type="text"],
    input[type="password"],
    input[type="datetime"],
    input[type="datetime-local"],
    input[type="date"],
    input[type="month"],
    input[type="time"],
    input[type="week"],
    input[type="number"],
    input[type="email"],
    input[type="url"],
    input[type="search"],
    input[type="tel"],
    input[type="color"] {
            color: #767676;
            background-color: #fafafa;
            border: 1px solid #dbdbdb;
            height: 25px;
            width: 100px;
            padding: 4px 20px;
            border-radius: 0;
            -webkit-transition: all 0.3s ease-in-out;
               -moz-transition: all 0.3s ease-in-out;
                -ms-transition: all 0.3s ease-in-out;
                 -o-transition: all 0.3s ease-in-out;
                    transition: all 0.3s ease-in-out;
    }
    textarea:focus,
    input[type="text"]:focus,
.site-info{
 display:none;
}

.site-title{
 display:none;
}
.search-form .search-submit {
	display:none; }

Leave a Reply

Your email address will not be published. Required fields are marked *