css positioning text after slider wordpress - html

I need some help with positioning my css elements in a wordpress theme. Here is my situation.
First, I call my header. Inside my header is my horizontal nav menu.
Next, I call my slider from the index.php. The slider is created in such a way as it takes up 100% of my screen width with 0 margin-top. Doing this allows my menu to be within my slider images.
My problem is that the next element I call is place directly under my menu, but I would like it placed under my slider images. How do I do this? Do I have to give my next element a margin-top equal to the height of my slider images? Seems there is probably a better way to do this.
The slider is only used on the index page, not on any of the sub pages.
I'm thinking maybe the right answer has something to do with the position tag but I'm not having any luck getting the functionality to work.
Here is the css for my slider positioning.
.slider {
position: absolute;
top: 0px;
width: 100%;
z-index: 1500;
}
Here is my index.php file
<?php get_header();?>
<section>
<?php get_template_part('slider', 'index');?>
</section>
<section>
<div class="row">
test
</div>
</section>
<?php get_sidebar();?>
<?php get_footer();?>
Here is my header
<body>
<header>
<section>
<div class="row">
<nav class="top-bar" data-topbar>
<ul class="title-area">
<li class="name"><h1><?php bloginfo('name');?></h1></li><li class="toggle-topbar menu-icon"><span>Menu</span></li>
</ul>
<section class="top-bar-section">
<?php wp_nav_menu( array( 'main-menu' => 'Main Menu', 'container' => false, 'walker' => new Top_Bar_Walker(), 'menu_class' => 'right'));?>
</section>
</nav>
</div>
</section>
</header>
And here is my slider-index.php file
<div class="row full-width slider">
<div class="preloader"></div>
<ul class="example-orbit" data-orbit data-options="timer_speed: 6000; slide_number: false; pause_on_hover: false; animation:fade;">
<?php
$args = array('category_name' => 'Featured');
$query = new WP_Query($args);
while($query->have_posts()) : $query->the_post();
?>
<li><?php the_post_thumbnail('featured');?>
<div id="<?php echo get_post_meta($post->ID, 'caption', true);?>" class="orbit-caption"><?php the_excerpt();?></div>
</li>
<?php
endwhile;
?>
</ul>
<div class="row shadow"><img src="<?php bloginfo('template_url');?>/img/bottom-shadow.png"></div>
</div>
Thanks for any help.

Related

How set nav-header to right side - Wordpress

How set header item to right side in wordpress ?
I tried with align = "right" but didnt work.
<body <?php body_class(); ?>>
<div class="container">
<!--site-header-->
<header class="site-header">
<div class="hd_search">
<?php get_search_form(); ?>
</div>
<span>
<h1><?php bloginfo('name');?></h1> </span>
<h5> <?php bloginfo('description'); ?> <?php if(is_page('portfolio')){?>
- Thank you for viewing my work
<?php } ?> </h5>
<div class="header" >
<nav class="site-nav" align="left">
<?php
$args= array(
'theme_location' => 'primary'
);
?>
<?php wp_nav_menu($args); ?>
</nav>
</div>
</header>
Set header to red arctangle. Click to view picture
Actuallu this is because of <header> does not support align atrribute, just replace it with div instead. Note that html5 does no longer support align attribute, so I suggest you to use CSS instead.
For example replace this <div align="center"> with <div style="text-align:center;border:1px solid red">, for the result you need check CSS reference manual and HTML reference from w3school.com
However, the property you need is the CSS attribute float, you can simply add to your <header class="site-header"> with <header class="site-header" style="float: right">

How to insert image above footer and remain still [WORDPRESS]?

I want to add a picture above the footer as seen picture below, or you can visit the website: http://creativelab.twofour54.com/en/
Example of the photo from TwoFour54
The website I'm testing it on is wordpress. I tried playing with the footer.php however it works nicely but when I stretch the site (zoom out or in) It gets ruined. I tried to make it static with position tag from CSS but that didnt work.
<div class="cfa" style="margin-left: 200px; width: 100%; z-index: 10;">
<div class="container">
<div class="col-sm-12">
<img src="http://localhost:8080/TESTWORDPRESS/wp-content/uploads/2017/01/Sketch-Book-icon.png">
</div>
</div>
</div>
<?php
/*
Template for Footer
*/
?>
<footer id="footer">
<div class="row clearfix">
<?php
if ( ! dynamic_sidebar ( 'footer_widgets' ) ){
thdglkr_emptysidebar('Footer');
}
?>
</div><!-- row -->
<?php if (_option('footer_menu','1')=='1'){ ?>
<div class="footer-last row mtf clearfix">
<span class="copyright"><?php echo _option('footer_text'); ?></span>
<?php
wp_nav_menu(
array(
'theme_location' => 'secondary',
'menu' => 'Footer Menu',
'container' => 'div',
'container_class' => '' ,
'menu_class' => 'foot-menu',
)
);
}else{?>
<div class="footer-last row mtf clearfix center">
<span class="copyright center"><?php echo _option('footer_text'); ?></span>
<?php } ?>
</div><!-- end last footer -->
</footer><!-- end footer -->
</div><!-- end layout -->
</div><!-- end frame -->
<?php if (_option('footer_gototop')==1): ?>
<div id="toTop"><i class="icon-angle-up"></i></div><!-- Back to top -->
<?php endif; ?>
<?php wp_footer(); ?>
</body>
</html>
note: code above is Footer.php from my test local host
Does anyone have any ideas?
Put your .cfa inside your footer in your html. And in your css:
.cfa {
position: absolute;
top: 0;
left: 200px;
margin-top: -100px; //change this to the height of your image
}
EDIT: Actually it's better if you can remove it from your HTML and just add it via css using a :before pseudo-element if you're using it just for design purposes.

Logo Image float on a Image Slider Wordpress Theme CSS

DISCLAIMER : I did not code the theme. This was made by another developer who left the project and I am making adjustments based on the new requirements. I don't have experience in Wordpress Theming but I can understand codes.
I am making a design in a website and I want to make my logo to be like floating above the Slider layer. I am working on a wordpress theme:
As you can see the Logo 'Red Dela Cruz' is on the top occupying a separate space or div. I want it inside the slider and floating on it like a layer, whenever the slide changes image, logo should still be there. Here is my code:
<div class="slider">
<img src="<?php echo $template_path; ?>images/redlogo_website.png" alt="" class="web-logo"/>
<div id="one-by-one-slider" class="one-by-one-slider">
<ul class="one-by-one-slider-large">
<?php
$args = array(
'post_type' => 'rdc_home',
);
query_posts( $args );
// The Loop
if ( have_posts() ) :
while (have_posts()) :
//the post for declaration
the_post();
?>
<li>
<img src="<?php echo wp_get_attachment_url( get_post_thumbnail_id($post->ID, 'thumbnail') ); ?>" alt="<?php the_title(); ?>"/>
<div class="slider-content text-center">
<div class="slider-heading shp-12 slides" data-animation="bounceInDown" data-duration=4 data-delay=1>
<div class="container">
<div class="row">
<div class="col-md-12">
<h1><?php the_title(); ?></h1>
</div>
</div>
</div>
</div>
<div class="slider-heading shp-13 slides" data-animation="bounceInDown" data-duration=6 data-delay=2>
<div class=" container">
<div class="row">
<div class="col-md-12">
<h3><?php the_content(); ?></h3>
</div>
</div>
</div>
</div>
<!-- <div class="slider-heading shp-14 slides" data-animation="bounceInUp" data-duration=8 data-delay=4>
<div class=" container">
<div class="row">
<div class="col-md-12">
For Bookings
</div>
</div>
</div>
</div> -->
</div>
</li>
<?php
endwhile;
endif;
wp_reset_query();
?>
</ul>
<div class="one-by-one-slider-nav">
<ul class="one-by-one-slider-thumbs">
<li class="one-by-one-slider-element"></li>
<?php
$args = array(
'post_type' => 'rdc_home',
);
query_posts( $args );
// The Loop
if ( have_posts() ) :
while (have_posts()) :
//the post for declaration
the_post();
?>
<li></li>
<?php
endwhile;
endif;
wp_reset_query();
?>
</ul>
</div><!-- one-by-one-slider-nav -->
</div><!-- one-by-one-slider -->
</div><!-- slider -->
The logo is on the 2nd line and I haven't done any css on class
web-logo
This should work:
.web-logo {
position:absolute;
}
If the logo goes "behind" the slider, you should add a z-index, and make it higher, untill the image is showing:
.web-logo {
position:absolute;
z-index:2;
}
you can try this one:
.web-logo {
position: absolute;
right: 10px;
top: 10px;
z-index:2;
}

Zurb Foundation data-topbar stops DIV from being complete

This is the code that I have for my navigation [in a WordPress site].
<div class="sticky">
<nav class="top-bar" role="navigation" data-topbar>
<div class="top_bar_inner">
<a class="logo" href="<?php echo home_url(''); ?>"><?php bloginfo('name'); ?></a>
<?php
$args = array(
'theme_location' => 'nav_main',
'container_class' => 'top-bar-section',
'container_id' => 'nav_main',
'menu_class' => 'right',
'depth' => 1
);
wp_nav_menu($args);
?>
</div>
</nav>
</div>
Now the problem is due to the data-topbar attribute the top_bar_inner DIV class does not wrap the logo and resulting menu items generated by the php code. It only wraps the logo <a> tag.
I have also tried data-topbar="topbar" but no change. Please help.
Not sure what you are trying to accomplish. If you are trying to have content show on all screen sizes and not fold into the mobile menu, you can do this by adding it as an <li> in the title area
<ul class="title-area">
<li class="name"><!-- Leave this empty --></li>
...
</ul>

Can be use condition in CSS?

Building a Wordpress theme and I am not on the first page but on other pages content to have.
This is the site:
http://avocat.dac-proiect.ro
I turned off main site
.masthead-fixed .site-main {
margin-top: 48px;
display:none;
For example ... if a user clicks on "Sample Page" I want #.masthead-fixed to be activate else...not be displayed.
It can do so in CSS?
What technology can I use?
It would help me a strong example to understand more clearly what to do.
Thanks in advance!
Look at the generated HTML. Each page will have some unique classes on the body tag. For instance, the frontpage will have a .home class, and depending on template, your body tag will also have a template class, e.g. .page-template-default. Most importantly, though, is that each page will have a unique id, e.g. .page-id-7. You can easily use these to differentiate between specific pages in your CSS.
So look at the source code of your "Sample Page", find its id and adjust the CSS accordingly:
body.page-id-X .masthead-fixed .site-main {
display: none;
}
If you want something to show only when you're not on the home page you can use the following PHP in your template file.
<?php if (!is_home() || !is_front_page()) { ?>
<div id="something">This div and content will only show up if we're not on the front page</div>
<?php } ?>
So here's a standard masthead found in header.php
<body <?php body_class(); ?>>
<div id="page" class="hfeed site">
<header id="masthead" class="site-header" role="banner">
<div class="site-branding">
<h1 class="site-title"><?php bloginfo( 'name' ); ?></h1>
</div>
<input type="checkbox" id="menu">
<label for="menu" class="menu-label" onclick></label>
<nav id="site-navigation" class="main-navigation" role="off-canvas">
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'container' => '' ) ); ?>
</nav><!-- #site-navigation -->
</header><!-- #masthead -->
<div id="content" class="site-content">
Change the above code to this:
<body <?php body_class(); ?>>
<div id="page" class="hfeed site">
<?php if (!is_home() || !is_front_page()) { ?> <!-- PLACE THIS LINE ABOVE YOUR HEADER -->
<header id="masthead" class="site-header" role="banner">
<div class="site-branding">
<h1 class="site-title"><?php bloginfo( 'name' ); ?></h1>
</div>
<input type="checkbox" id="menu">
<label for="menu" class="menu-label" onclick></label>
<nav id="site-navigation" class="main-navigation" role="off-canvas">
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'container' => '' ) ); ?>
</nav><!-- #site-navigation -->
</header><!-- #masthead -->
<?php } ?> <!-- PLACE THIS CODE AFTER THE HEADER -->
<div id="content" class="site-content">
This will display your header on all pages except your home page.