Wordpress theme scrolling page issue - wordpress

First of all, the disclaimer: I am an absolute newbie.
I am modifying this theme, and, so far, I've come up with this.
My problem is the scrolling effect (amongst other things): when one clicks on one of the links in the circles, the scrolling effect will stop too 'early', as if the anchor were set too 'high' in relation to the text, leaving lots of white space above it.
I could try to set another anchor, perhaps a single character of the same colour of the background next to the h1 of every section, but I fear I might lose the scrolling effect. Also, I don't really know how to do that in WP.
So, in substance, my question is: how do I set the page to scroll so that the heading of each page is closer to the top of the screen?
Not sure if this of any use, but the following is the content of the template-home.php file, relating to navigation:
<div class="row">
<nav class="<?php if (get_post_meta($post->ID, 'fw_label_four', true)) { ?> offset2 <?php } else {?>offset3 <?php } ?> span8" id="nav-home">
<ul class="row">
<li class="span2">
<a class="circle-menu circle-black" href="#page-2"><span class="label-link"><?php echo get_post_meta($post->ID, 'fw_label_one', true);?></span></a>
<span class="arrow"></span>
</li>
<li class="span2">
<a class="circle-menu" href="#page-3"><span class="label-link"><?php echo get_post_meta($post->ID, 'fw_label_two', true);?></span></a>
<span class="arrow"></span>
</li>
<li class="span2">
<a class="circle-menu circle-black" href="#page-4"><span class="label-link"><?php echo get_post_meta($post->ID, 'fw_label_three', true);?></span></a>
<span class="arrow"></span>
</li>
<?php if (get_post_meta($post->ID, 'fw_label_four', true)) { ?>
<li class="span2">
<a class="circle-menu" href="#page-5"><span class="label-link"><?php echo get_post_meta($post->ID, 'fw_label_four', true);?></span></a>
<span class="arrow"></span>
</li>
<?php } ?>
</ul>
</nav>
</div>

Related

Bootstrap Carousel ACF repeater - arrows not working

Good morning,
I'm currently developing on the understrap-child theme and I have an issue with a Bootstrap Carousel which I made into a repeater using Acf pro plug-in on Wordpress.
The issue is about the indicator arrows not working. The slider is perfectly working as a repeater, but the right arrow (carousel-control-next) does not work, only the left one allows me to interact with the slider.
I'm wondering if the issue is related to the repeater itself or with me making some stupid mistake I'm not able to see! PLEASE HELP ME
Here's my code:
<div class="container-fluid containerslider sliderdesktop container-home-sub ">
<div id="HomeCarouselIndicators" class="carousel slide" data-ride="carousel">
<!--indicators-->
<?php if( have_rows('slider') ): $i = 0; ?>
<ol class="carousel-indicators">
<?php while ( have_rows('slider') ): the_row(); ?>
<li data-target="#HomeCarouselIndicators" data-slide-to="<?php echo $i; ?>" class="<?php if($i == 0) echo 'active'; ?>"></li>
<?php $i++; endwhile; ?>
</ol>
<?php endif; ?>
<!--end of indicators-->
<div class="carousel-inner" role="listbox">
<?php // check if the repeater field has rows of data
$count = 0;
if( have_rows('slider') ){
//loop through
while ( have_rows('slider') ){
//define the row
the_row();
?>
<!-- Slide One - Set the background image for this slide in the line below -->
<div class="carousel-item subheader-carousel <?php if ($count==0) {echo "active";} ?>" style="background-image: url('<?php the_sub_field('slider_background'); ?>')" >
<div class="">
</div>
</div>
<a class="carousel-control-prev" href="#HomeCarouselIndicators" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#HomeCarouselIndicators" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
<?php
$count=$count+1;
}
}
?>
</div><!--end of carousel inner-->
</div><!--end of homecarouselindicators-->
</div><!--end container slider-->
At a glance, you have your controls inside your carousel-inner.
https://getbootstrap.com/docs/4.0/components/carousel/
Shows the controls being outside the carousel-inner but inside the carousel.

Foundation 6 Wordpress theme

I am trying to add some animation to the mobile navigation to drop down slowly rather than have the page jumping. I am using the foundationpress theme. I can't seem to make it work with data-animate. This is my code snippet:
<div class="title-bar" data-responsive-toggle="site-navigation">
<button class="menu-icon" data-toggle="panel" type="button" data-toggle="mobile-menu"></button>
<div class="title-bar-title">
<div class="mini-logo">
<img class="mini-logo-img" src="/wp-content/uploads/2016/11/coc-logo.png" alt="Mountain View" style="width:4rem;height:auto;">
</div>
<!--<?php bloginfo( 'name' ); ?>-->
</div>
</div>
<!--<nav id="site-navigation" class="main-navigation nav-area" role="navigation" style="width:100%" >-->
<div class="top-bar-left">
<ul class="menu">
<li class="co-logo-top"></li>
<!--<li class="home"><?php bloginfo( 'name' ); ?></li>-->
</ul>
</div>
<div class="top-bar-right" >
<?php foundationpress_top_bar_r(); ?>
<?php if ( ! get_theme_mod( 'wpt_mobile_menu_layout' ) || get_theme_mod( 'wpt_mobile_menu_layout' ) === 'topbar' ) : ?>
<?php get_template_part( 'template-parts/mobile-top-bar' ); ?>
<?php endif; ?>
</div>
</nav>
I'm not seeing the actual '#mobile-menu' component in your code snippet, so not 100% sure what's happening here, but the thing to be aware of is that you need to have the data-animate attribute on the same element as you have your data-toggler attribute (which in this case is the thing being toggled, or '#mobile-menu'). See the example here: http://foundation.zurb.com/sites/docs/toggler.html#toggle-with-animation
have you tried triggering it with jquery/js? see this thread: https://github.com/olefredrik/FoundationPress/issues/772.
also check that you have added the data-toggler attribute to the element

Delete div from menu block drupal 7

How can I delete all thoses div around my menu create with menu_block for drupal 7 ?
I want to change this :
<div class="region region-nav">
<div class="content">
<div class="menu-block-wrapper menu-block-3 menu-name-menu-prive parent-mlid-0 menu-level-2">
<ul class="menu">
<li class="first expanded menu-mlid-559" style="width: 397px;">
Avantages
<ul class="menu">
<li class="first leaf menu-mlid-596">
Ecologie
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
into this :
<ul class="menu">
<li>
link
<ul class="menu">
<li>
link
</li>
</ul>
</li>
</ul>
Thank you
You will need to add new templates for your block and the region that holds it, in order to get rid of some of the markup.
Take a look at Drupal 7 Template Suggestions
Your block template name would look like this: block--menu-block.tpl.php. And for the markup, can be just
<?php print $content ?>
The region template name would look like this `region--YOUR_REGION_NAME.tpl.php``. And for the markup, can be just
<?php print $content ?>
(Don't forget to flush the caches after adding the new templates)

Wordpress: Added sidebar - random div being generated above widgets?

I've added a new sidebar to my theme. It works, but a strange div with a height is appearing above any widgets I add to it:
<div id="blogsidebar">
<ul>
<div style="height: 280px;"></div> <---???
<li>WIDGET HERE</li>
</u>
</div>
My sidebar.php code is:
<div id="blogsidebar">
<ul>
<?php
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('blog-sidebar') ) :
endif; ?>
</ul>
</div>
I have checked for any JQuery thats adding this and found none. Would anyone know why this is occurring?

Fixed position div displaying transparent on iOS6 Safari

I currently have a div that changes to fixed position at the bottom of the page when shown on a phone resolution and is supposed to display the author content. When clicking this div a menu slides up using jquery. At this time, the div displays transparent, but when clicking on the location the div should be, it slides the menu open just like it should.
I'm not sure what's going on, but all the debugging I have done has led to nothing. Has anyone else experienced this, or know how to resolve it?
Here's the HTML/CSS for that piece:
<div id="secondaryBox" class="span6 pull-right">
<div id="author" class="collapsed">
<?php if(!empty($user['avatarPath'])){?>
<img src="<?php echo $user['avatarPath'] ?>" class="avatar avatar-50 photo avatar-default" height="50" width="50" />
<?php }else{
echo get_avatar( $current_user, 50);
} ?>
<h5><?php echo $user['displayName']; ?></h5>
<h6><span class="hidden-phone"><?php echo get_current_user_role($user['role']) ?>, </span><?php echo $user['schoolName']; ?></h6>
<div id="phoneCaret" class="circleCaret visible-phone"><b class="caret"></b></div>
</div>
<?php if ( current_user_can('read') ) { ?>
<div id="hiddenMenu">
<div class="addMenu hidden-phone collapsed">
<span>Additional Options </span>
<div class="circleCaret"><b class="caret"></b></div>
</div>
<ul id="slideOutMenu">
<?php if ( current_user_can('add_users') ) { ?>
<li><i class="icon-th-list icon-white"></i> Manage Users</li>
<?php if(is_super_admin($current_user->ID)){?>
<li><i class="icon-th-list icon-white"></i> Export Users</li>
<?php }?>
<li class="divider"></li>
<?php }
if ( current_user_can('manage_categories') ) { ?>
<li><i class="icon-plus icon-white"></i> Create School</li>
<li><i class="icon-tags icon-white"></i> Manage Categories</li>
<li><i class="icon-edit icon-white"></i> School Settings</li>
<li class="divider"></li>
<?php }
if ( current_user_can('manage_network_options') ) { ?>
<li><i class="icon-globe icon-white"></i> Network Sites</li>
<li><i class="icon-wrench icon-white"></i> Settings</li>
<li><i class="icon-cog icon-white"></i> WP Engine Settings</li>
<li><i class="icon-wrench icon-white"></i> Login Attempts</li>
<li class="divider"></li>
<?php } ?>
<li><i class="icon-home icon-white"></i> My Dashboard</li>
<li><i class="icon-globe icon-white"></i> Dewsly.com</li>
<li><i class="icon-user icon-white"></i> My Profile</li>
<li><a target="_blank" href="http://support.dewsly.com"><i class="icon-question-sign icon-white"></i> Support</a></li>
<li><a onclick="return confirm(\'Do you really want to logout?\')" href="<?php echo get_site_url(1); ?>/?my_error=logout"><i class="icon-off icon-white"></i> Logout</a></li>
</ul>
</div>
<?php } ?>
</div>
CSS:
#author{
position:fixed;
bottom:0;
left:0;
width:100%;
background-color:#212121;
height:70px;
z-index: 1001;
overflow:hidden;
cursor:hand;
padding:10px;
border-top:1px solid #595555;
}
#secondaryBox {
height: 0px;
position:fixed;
bottom:70px;
width:100%;
overflow:auto !important;
left:0;
z-index: 100;
}
After quite a bit more reading the issue was having a fixed position div within a scrolling div. The information given in the comments of the post linked from here gave me the guidance. Although that is frustrating, at least I know how to resolve the issue now.
http://remysharp.com/2012/05/24/issues-with-position-fixed-scrolling-on-ios/
ugly but working solution for this;
setTimeout(function() {
$("#fixedElement").css("right", "373px");
}, 100);
I am not sure why, after you change/set position of element, it becomes visible again.

Resources