Digital experiences for all disciplines
New Landing › How can we help? › Atelier › Menu in footer displaying Order #XXXXX instead of the menu item name
New Landing › How can we help? › Atelier › Menu in footer displaying Order #XXXXX instead of the menu item name
- This topic has 9 replies, 3 voices, and was last updated 8 years by David Martin – Support.
-
Posted in: Atelier
-
March 1, 2016 at 3:41 pm #253003
As the subject suggests, I am having an issue with a footer menu when I’m on the view-order page.
Instead of the title displaying as “Frågor & svar” it’s displaying “Order #17131”. The thing is that it only does this on the view-order page. I have been searching for the issue for hours but gave up. The same issue cannot be reproduced on any other theme so I am certain that it has something to do with your theme. I have also tried to switch from the child theme to Atelier but I get the same issue.
Look at the provided screenshot for more info.
Thanks in advance
Attachments:
You must be logged in to view attached files.March 3, 2016 at 11:36 am #253389Hi,
Is there any scope to test this all plugins deactivated leaving only Woo and Swift Framework active?
– Can we have access to the login details with an order?
– Swift Framework 2.0.2 has now been released, you look to be using 1.66?
Thanks.
March 3, 2016 at 3:45 pm #253466Is there any scope to test this all plugins deactivated leaving only Woo and Swift Framework active?
I have tested this on my local machine, I don’t want to deactivate everything on this site since it’s going to be published live soon. An important note is that I have tried WordPress twentythirteen with the same plugins by just switching to that theme and it don’t feature the same issue.– Can we have access to the login details with an order?
I have created an order for your login.– Swift Framework 2.0.2 has now been released, you look to be using 1.66?
That was true, I have updated now – still have the issue though 🙁March 3, 2016 at 9:24 pm #253534What I discovered was that in the page template you are running:
if( have_posts() ) : the_post();
and not
while( have_posts() ) : the_post();
This means that the code setting the query variable “in_the_loop” is not set to false.
This means that you are not ending “the loop”.
WooCommerce has a add_filter for “the_title” which checks for in_the_loop() to check if the title is the main page title.
“the_title” also runs for all the menu items in the footer menu.
I will do a quick-fix for my customer by overriding the page.php – file and adding have_posts() in the bottom of the file just before the footer code.
Please have a look at this.
March 7, 2016 at 12:41 pm #253904Hi,
Are you referring to this file?
/swift-framework/layout/page.php
This output is whatpage.php
will use.Have you tested this? We can incorporate this into a future release.
Thanks.
March 8, 2016 at 11:06 am #254097Yes exactly, I am referring to that file.
It looks like this right now:
<?php if ( have_posts() ) : the_post(); ?> <?php do_action( 'sf_page_content_before' ); ?> <div <?php post_class( 'clearfix' ); ?> id="<?php the_ID(); ?>"> <?php do_action( 'sf_page_content_start' ); ?> <?php the_content(); ?> <div class="link-pages"><?php wp_link_pages(); ?></div> <?php /** * @hooked - sf_page_comments - 10 **/ do_action( 'sf_page_content_end' ); ?> </div> <?php do_action( 'sf_page_content_after' ); ?> <?php endif; ?>
And the loop is never closed since no have_posts() are being run after the last post has been “printed”.
I suggest this instead:
<?php while ( have_posts() ) : the_post(); ?> <?php do_action( 'sf_page_content_before' ); ?> <div <?php post_class( 'clearfix' ); ?> id="<?php the_ID(); ?>"> <?php do_action( 'sf_page_content_start' ); ?> <?php the_content(); ?> <div class="link-pages"><?php wp_link_pages(); ?></div> <?php /** * @hooked - sf_page_comments - 10 **/ do_action( 'sf_page_content_end' ); ?> </div> <?php do_action( 'sf_page_content_after' ); ?> <?php endwhile; ?>
Although we know that there will only be one post WordPress is built with a loop, allowing for more than one post.
My suggestion adds a while loop instead of an if-statement, this will make have_posts() run one more time after the_post() has been called.
Since I can’t override the swift-framework files I have added my quickfix to the
atelier/page.php
file, adding ahave_posts()
beforeget_footer()
, closing the loop.March 9, 2016 at 2:28 pm #254417Thanks, I’m just going to run this past the lead developer for his review also.
Cheers,
David.March 9, 2016 at 2:43 pm #254422Thanks @BBMagnus – will integrate that for the next update. Appreciate it.
– Ed
March 16, 2016 at 9:33 am #255728Thank you! 🙂
March 17, 2016 at 11:17 am #256018Great, thanks Ed.
-
Posted in: Atelier
You must be logged in and have valid license to reply to this topic.