Site logo

Archived topic

Main Menu Lables Disapearing on Search Page

9 replies · Started by upsilva1982 on May 19, 2021

Viewing posts 1–10 of 10

Hi,

I updated the main menu, and everything looked nice.

Before doing this, I did a backup of all my worpress website, just in case.
(Restored it to the before updating of the main menu updating, and no solutions)

However, I retested my search box again(with no menu updated), and on the search query(WP_Query) result, if the “else” statement of the loop is reached, the rest of the search page is builded nicelly, but the main menu lables.

The “generate_do_template_part( ‘none’ );” builds the rest of the page nicelly, but the main menu lables wont come back. 🙁

How can I solve this?

Thanks in advance guys.

Cheers

(By the way, i edited it, by using the drag an drop customization of the theme and while doing the movings around, I noticed lots of flickering.)

Hi there,

Any chance you can link us to the site in question?

You can use the private information field.

Let me know :)

Hi, ok, link on the private section,

I added it with a non existent word in the entire website.

Thanks for the support.

Hi there,

Is the search query a custom development ?

Hi,
No it is Not customized, but even with the original search file (that uses the built-in WP_Query), it keeps doing this.

And it just "breaks" on the loop, on the else statement.

I try allready closing the loop, trough varius options, so the page can continue the building, and no sucess.

Is there annyway that we can tell the loop, like: "hey loop, in this website, nothing matches the query, but dont go away cus i am not finished yet. process my esle data" ?

Thanks

Sorry - i am a little confused.

You say its not custom development but then say this: And it just “breaks” on the loop, on the else statement. - are you using a Custom template or other functions ? Really hard for us to debug an issue if there us custom work involved.

Sorry,

I am doing coding (Listing stuff with images) inside the loop that looks for posts inside the query on the "search.php" file.
like this:

if ( generate_has_default_loop() ) {
if ( have_posts() ) :
while ( have_posts() ) :
//the_post();
generate_do_template_part( 'search' );
..... My listing stuff codes here ......
endwhile;
do_action( 'generate_after_loop', 'search' );
else :
generate_do_template_part( 'none' );
..... And here Is where i would like to list other stuff ......
endif;

But even with nothing in the else state, it just loads the template_part 'none' correctlly, and finishes the page, but the main menu the lables are remove somehow.

(I changed the answer cus i realized i did get your question rigth, sorry for that)

Cheers (Y)

No problems :)
Are you able to save your Custom Template to a GIST and share the entire code with us ?

Hey David,
sorry for taking so long to answer.
I finally managed to solve it after some time.

It was my mistake.!

I am so sorry for bothering you.

I misused the "nav_menu_item_title" hook.

You guys, you are so GREAT at helping us, that I ended up realizing my mistake, by reading a similar case that your colleague Tom helped a while ago.
Here is the link to it, for those who may need it Lose Navigation Menu Labels when using DAP & has sub-menu items.

Thanks a LOT again Man and BIG HUG to you and the whole team.

Awesome - Glad to hear you got it resolved :)

This archived topic is closed to new replies.