Forum Replies Created
-
AuthorPosts
-
Hi Andy,
I didn’t fix it. I removed the code because I couldn’t leave it like that on our live site.
Thanks for the reply Jose. That placed 2 search boxes in the navigation (screen cap.), but they were in the correct location. Any ideas why it placed 2 of them in the navigation?
Thank you too Arvish, but that function didn’t move the search box.
October 22, 2014 at 3:53 pm in reply to: Responsive Main Menu not appearing on iPhone 6 Plus #339501It seems like both of the iPhone 6 Plus we saw the issues on fixed themselves. I’m not sure what happened initially, but it seems like everything is good to go. Thanks!
Thanks again for all of your help. 2 things:
- The search box now appears at the end of the main navigation. Is there a way to make it appear between “Paintball FAQs” and “Cart” from within the function? Or do I have to place the code for “Cart” and “My Account” with the search box function? I would like to keep as much as possible within the menu layout.
- I placed the code below into functions.php, but it no longer recognizes when the enter button is pressed. Any ideas? Could I be calling the JS file from the wrong place? It is being called from the header right before
<?php wp_head(); ?>
. I checked the source code, and the path to the JS file is correct.
/* * Add search box to main menu */ add_filter('wp_nav_menu_items','add_search_box_to_menu', 10, 2); function add_search_box_to_menu ( $items, $args ) { if( $args->theme_location == 'avia' ) return $items."<li style='margin:9px 0 0 !important;'><input type='text' class='search' id='txtSearch' name='txtSearch' maxlength='150' onkeydown='javascript:return IsEnterPressed(event, document.getElementById('txtSearch').value, document);' /></li>"; return $items; }
No I haven’t tried wp_nav_menu_items yet. Thank you for bringing it to my attention! Would the functions file be the best location to place the filter’s code?
Hi Ismael,
I only asked because I was directed to place the code within the menu structure in a previous response. If there is a way I can place the search box after “Paintball FAQs” and before “Cart” that would be fine too. Even inserting code that strips the anchor tag from the search box would be helpful. If this still conflicts with the support policy, that’s fine as well.
Thanks for the catch! A team member commented out the function from the JS file and didn’t let me know.
New issue: The search box now recognizes the enter button press and sends the viewer to the shop site to view the results, but it isn’t sending the search terms through with it causing a 404 error. However, if I click back and then press enter again the search terms are sent through and the results populate. I don’t have that issue if I remove the search box from the main navigation and place it within a page. The only difference I see in the code is an anchor tag is placed around the search box when it is placed within the menu structure, and it isn’t there when the search box is placed within a page. Any ideas on why the text in the search box isn’t being sent on the first try? Could I be calling the JS file from the wrong area or is there a “preferred” area to call it from?
Image of the URL on first and second enter press: https://www.dropbox.com/s/gemlhczumus43xn/search-terms.jpg?dl=0
Thanks! I was able to get the search box to appear in the navigation, but it isn’t recognizing when the enter button is pressed. Below is what I placed inside the Navigation Label. Any ideas?
<input type="text" class="search" id="txtSearch" name="txtSearch" maxlength="150" onkeydown="javascript:return IsEnterPressed(event, document.getElementById('txtSearch').value, document);" />
The website is now live if you would like to see how the searchbox is currently functioning.
September 10, 2014 at 5:14 pm in reply to: Custom sticky footer navigation isn't displaying properly #316769I resolved the issue. I wanted a sticky footer, but I should’ve been looking at a scrollToFixed div. The navigation now stays at the bottom of the browser window and stops when it encounters a defined class. Thank you again for helping me despite not being able to see the website.
September 2, 2014 at 6:23 pm in reply to: Custom sticky footer navigation isn't displaying properly #312458I tested the site in the latest versions of Firefox, Chrome, and IE11 on Friday and today, Tuesday, but the floating footer appears on all pages even after clearing the cache in Chrome. Unfortunately the website is on a test server that can only be accessed from within the building. We plan on going live soon. I will definitely post a link once it is available. Thank you for continuing to help.
August 29, 2014 at 10:23 pm in reply to: Custom sticky footer navigation isn't displaying properly #311096I found what I believe is the page ID, 3158, by hovering over the “move to trash” link, but the footer still appears on every page and outside of the main content area. Below is the code I used.
function sticky_footer() { if(is_page(3158)) ?> <div class="sticky-footer"> <div class="wrapper"> <p>Some text here, and some more and some more and a bit more.</p> </div><!-- end .wrapper --> </div><!-- end .sticky-footer --> </script> <?php } add_action('wp_head', 'sticky_footer');
August 25, 2014 at 9:34 pm in reply to: Custom sticky footer navigation isn't displaying properly #308980Thank you for the help and sorry for the delayed reply.
That function and CSS fixed the issue with the Enfold footer text being on top of the sticky footer. However, the sticky footer remains at the bottom of the page within the footer and it now displays on every page of the website. Is there a way to call the function only on the team page and have it stay within the page’s content area?
New screenshot: https://www.dropbox.com/s/9a8vx99lp4ul56r/Capture08252014.PNG?dl=0
August 21, 2014 at 8:37 pm in reply to: Custom sticky footer navigation isn't displaying properly #307519The text above is what is all of the code currently on the page. “The Family” is text that describes the content we are using for the page. It is a page showing the teams we sponsor. The sticky footer code starts is just the section below:
<div style="background-color:red; height:80px;"> </div> <div class="sticky-footer"> <div class="wrapper"> <p>Some text here, and some more and some more and a bit more.</p> </div><!-- end .wrapper --> </div><!-- end .sticky-footer -->
As well as the style section that makes it into a sticky footer:
<style> /* Sticky Footer Styles */ .sticky-footer { position: fixed; bottom: 10px; z-index: 999; width:100%; background: #ffffff; border-top: 1px solid #999999; border-bottom: 1px solid #999999; padding:5px 10px; max-width:1002px; } .sticky-footer p { color: #000000; text-align:center; } </style>
The rest of the code is just the content that I added so far and can be disregarded. To me it just seems like the sticky footer is jumping outside of the content area of the page, and we would like it to only stay within the content area. We’re planning on going live within the next month, and I will let you know when that happens.
August 19, 2014 at 5:53 pm in reply to: Custom sticky footer navigation isn't displaying properly #306445Thank you for the reply. I will work with our IT department to see if it’s possible to grant you access to the page.
If that doesn’t work, do you know of a WordPress plugin that works well with Enfold that could provide the end result we’re looking for? I don’t mind altering styles if necessary.
August 19, 2014 at 3:59 pm in reply to: Custom sticky footer navigation isn't displaying properly #306389Unfortunately the website is still being built and is on our internal test server. Because of that, only people within the building/company are able to see the website, but I did include screenshots below. I added the code directly to the Teams page. The style section is only there until everything is working. Then it will be moved to the custom.css file.
In the first screenshot, the sticky footer appears below the website’s footer container class div. In the second image the website footer is covering the sticky footer, and it is the same in the third image. Is there a way I can tell the sticky footer to stay within the page’s content area and always be at the bottom of the browser’s visible area but not scroll past or cover the website’s footer?
Here is a mockup of how we would like the sticky footer to behave: https://www.dropbox.com/s/1l4izgu1wibpyya/teams%20page.jpg
https://www.dropbox.com/s/or33xjbhgtopyj3/capture1.png
https://www.dropbox.com/s/cad7ixlm7hpjbvs/capture2.png
https://www.dropbox.com/s/j35gsaamoig7ccc/capture3.pngThanks! That took care of the delay.
Thank you, that resolved the fading. Is there a way to remove the delay when the menu first appears and when it disappears once I move my cursor off of it? There seems to be about a 1 second delay for appearing and disappearing.
-
AuthorPosts