Archived topic
Logo on mobile menu
27 replies · Started by themedleb on September 21, 2017
I tested it and it worked (You missed the closing of the 8th line though).
Thank you.
Awesome!
Technically it doesn't need an opening or closing as it's a one line conditional, but I've added it in there for good coding standards :)
Okay, just because I tried to put the code on the "Snippet" plugin, and after clicking on the "Save changes" button this appeared:
Don't Panic
The code snippet you are trying to save produced a fatal error on line 8:
syntax error, unexpected ';', expecting ',' or ')'
The previous version of the snippet is unchanged, and the rest of this site should be functioning normally as before.Please use the back button in your browser to return to the previous page and try to fix the code error. If you prefer, you can close this page and discard the changes you just made. No changes will be made to this site.
Anyway, thank you so much for your help and support, never thought I could make such things with your product/products.
Looks like it's missing a closing bracket.
I've edited it. Try it again :)
I did thank you.
No problem!
This looks really close. Only issue I see is that this is happening on the author page, when there are no posts there. So there are in fact posts. Just none showing on the author page.
Hi Damon,
Not quite sure what you mean.
Any chance you can open a new topic and provide a link to your site with a bit more details?
Thanks!
Thank you Tom. That code is close, but not quite working since this is an author page. I'm guessing this is because there are in fact posts, but none yet by this author.
Here's the page, until the author creates a first post:
https://www.dropbox.com/s/h0xjsrcuo1xtkhm/1.png?dl=0
Here's the page after the first post:
https://www.dropbox.com/s/gcvlipa0l2a34k8/2.png?dl=0
I'm trying to redirect that first confusing page to another page that has instructions for creating a first post.
Hi Damon,
I don't think you are replying to the correct post here.
Ack, sorry about that. Yes, please close this topic.
Thank you, this helped to sort a similar situation, related to a specific CPT
// Redirect 404 errors of specific CPT "eventos"
add_action( 'template_redirect', 'tu_redirect_no_results' );
function tu_redirect_no_results() {
global $wp_query;
if ( 0 === $wp_query->post_count && $wp_query->query['post_type'] == 'evento' ) {
wp_redirect( site_url( '/sem-eventos' ) );
}
}
I am talking of this: https://generatepress.com/forums/topic/logo-on-mobile-menu/#post-392010
Thanks for sharing your solution!