Menus – Set certain items in the Nav Walker to Archive pages or Singles to Active

I have created a custom post type for events and a link in my menu to the archive page for this event (/ events).

I use wp_nav_menu () to call up the menu.

When I'm at / at events, the menu has the current_menu_item Class and I designed that to change the colors. That works perfect.

However, I would like to improve this a little by setting the menu item to "Active", even if someone is on a particular page.

I've created a page to show my past events (/ past events). It is controlled by a file called page-past-events.php, The idea is when a user is turned on / past events The event link is displayed as active. Since I have no menu item for it, I want that event Menu item to have the active class. Ideally, this element would be active if a user is also at one of the individual events (events / event-12).

My current code is

        wp_nav_menu (array ()
& # 39; # 39 & theme_location; => & # 39; headerMenu & # 39 ;,
));

I found this code for my functions.php:

Function my_special_nav_class ($ classes, $ item) {
if (is_page (& # 39; past-events & # 39;)) {
$ Classes[] = & # 39; current menu item & # 39 ;;
}

Return $ classes;
}
add_filter (# nav_menu_css_class), # my_special_nav_class # 10, 2);

However, it is not my menu item for events.

I can do it with a script like this:


    

But I was hoping for a "WordPress way".

title – How do I remove nav menu tooltips? (Wp globe plugin)

I would like to remove all tooltips from my nav menu, as it can not recognize in which language the title stands. I used the Wp-Globus plugin for a multilingual website. This issue occurred after the sites were created in both languages.

Enter the image description here

I do not need the tooltips, so I found a tooltip deactivation plugin (https://wordpress.org/plugins/tags/remove-tooltips/), but it's not compatible with my design.

Do you have an idea or solution to this problem?

Many Thanks!

html – How to span a div and nav bar over the entire height without hardcoding

I tried to create a simple web page with this format:

  1. Header (navigation bar with multiple tabs, height (say 50px))
  2. Main content (div)
  3. Footer (navigation bar with a height of approx. 50px)

Code can be found below:



  
  
    
Hello
content

The problem is that obviously the height of the middle part is hard-coded and that does not seem to be too big …

Try 1

I tried this with the help of version specific calc () for CSS, and I've got some pretty good results:



  
  
    
Hello
content

The problem is that 1) it uses a hard-coded value of 100px, and since my tab bars have a variable size depending on the size of my font, this is not really good. Looks really good …

Trial 2

The second thing I tried was using the Flexbox version specific Method. The problem with that is that it just did not work …? I do not even know why it did not work, but I'm not that familiar with Flex-Box at all.



  
  
    
Hello
content

These are the only things I've tried … I know there's an easy way to do this with the ad: fixed, but text can be moved behind my header and footer, and I do not want that either , Thank you in advance for your help!

nav bar – The bootstrap line break does not occur

Good night, I'm learning to use Bootstrap 4. I have created a menu with Navbar and Nav-Brand, everything works normally, but if it arrives in different sizes sm and md, the background becomes smaller than the menu links. That's why I tried to keep the links under the logo, but the links do not go to another line when I set col-sm-12. When I use col-sm-12 from Navbar, it works normally.

if any have any thanks.
Thank you



    Bootstrap Course
    
    

    
    


    

    
    
    
    

angle2 – Angular 7 – Nav display for sub-component for router output against iframe

I've created an Angular 7 web app for the data-driven display of navigation items and content to display when a navigation item is selected.

I have the following nav article interface:

Interface NavItem {
Title: String;
Symbol: string;
link: string;
Pages?: NavItem[];
}

Where it can be implemented for an Angular route:

Title: "Home",
icon: & # 39; faCoffee & # 39 ;, from Material CSS
link: & # 39; / home & # 39 ;, // Note that this is an angular route
Pages: zero

Or so:

Title: "Company name",
icon: & # 39; faCompany & # 39 ;,
link: & # 39; http: //subdomain.company.com&#39 ;, // Note that this is an external URI
Pages: zero

I have the following in nav.component.html:



    // (2)

in the nav.component.ts

Export class NavComponent {
rawLink: string = "/";

public navList: NavItem[];

changeLink (link: string) {// (1)
this.rawLink = link;
}
}

The content delivery policy is defined as follows:

content-display.component.ts:

@Component({
Selector: & app; content-display & # 39 ;, // (2)
templateUrl: & # 39; ./ content-display.component.html & # 39 ;,
styleUrls: ['./content-display.component.scss']
})
Export class ContentDisplayComponent implements OnInit {

private _link = & # 39; & # 39 ;;
isAngularLink = true;

@Entrance()
set hyperlink (hyperlink: string) {// When a setter is triggered by (1), the value is checked to see if it is an angular route. The output then decides whether to display an angle output or iframe.
this._link = hyperlink;
this.isAngularLink = this.checkIfAngularLink ();

if (this.isAngularLink) {
this.router.navigate ([`${this._link}`]);
}
}

Get Hyperlink (): string {
return this._link;
}

trustedLink = () => {
return this.sanitizer.bypassSecurityTrustResourceUrl (this.hyperlink); // Must be a function, as opposed to a property that calls
}

Constructor (private sanitizer: DomSanitizer, private router: router) {}

ngOnInit () {}

checkIfAngularLink () {

if (this._link.indexOf (& # 39; company.com & # 39;)> 0) {
return it incorrectly;
}

return true;
}
}

On content-display.component.html:

The end result is:

The parent component (nav.component) displays a child component (content-display.component). When a link is clicked on a parent component, the hyperlink property of the child component receives the link. It verifies that it is an angular route to external resources.

  1. When a user clicks on a navigation link that points to an internal Angular page, the router output displays the output
  2. When a user clicks on a navigation link that points to an external URI, an iframe is called to display the output.

I have the feeling that the child component (content-display.component) knows too much and does too much and may need to be redesigned. However, I do not expect the child component to be reused by other parts of the web app.

html – A Nav is inserted in the header

Could you clarify a doubt that I have?
I'm a 1st semester student, only software development. I have to create a website with HTML and CSS. I need to explain or help myself with the code to call a navigator bar In a header image I have, the image is large, the width takes up the entire header, but high is not that big, the idea is like the background image leaving the Nav

Could you help me?

code

tics
text
Centered text

            



        

THE IDEA IS THE NAVI IN THE PICTURE "cabecera"

Nav Bar or no Nav Bar

I'm creating a mobile app with a flat hierarchical structure. The users navigate mainly with a slide-out menu (nav drawer). The screens at the top hierarchical level of the app have switches with long names to toggle between users and their friend's information. I'm thinking about eliminating the navigation bar. Should I have concerns that Google or Apple will approve the app? I would also like to receive constructive suggestions.

Enter the image description here

html – How to centralize a UL horizontally and vertically in a nav?

See if that's what you need:

* {Margin: 0; Padding: 0;}
nav
Width: 100%;
Height: 100px;
Background: gy;
Margin: 0 car;
Align text: center;
Background: rgba (0,0,0, 0,6);
Display: Flex;
Align elements: center;
}
nav ul {
List style: none;
Margin: 0 car;
}
nav ul li {display: inline; padding: 5px; Cushion pad: 50px;}
nav ul li a {text decoration: none; Font size: 20px; Color white; Top edge: 50px}
nav ul li: hover {background: rgb (18, 155, 219); Transition: 1s linear}


Body {
Background: URL (https://i.ytimg.com/vi/0517Im379dI/maxresdefault.jpg);
Background repetition: no repetition;
Background size: 100%;
}



    
    
    
    document
    
   


    


Recommended Reading: CSS Tricks – A Complete Guide to Flexboxing

Navigation – How can I replace the HTML structure in the Nav Walker for nested lists in menus?

In my conditional section of my navwalker, in my start_el Function, if I have the following condition ….

    if ($ args-> walker-> has_children) {
// Change code here to change list and anchor link items for parent list items with children.

}

How can I tell my Nav Walker to change my status submenu Elements? For example, I want that …


…his….


Can you restructure that?