I'm working on a new webpage for my blog # http://bornsquishy.ca
I'm also trying to use a grid system by http://gridiculo.us/
The problem that I'm having is the div class "grid" is being closed off at the end of the header without a closing div tag, and I can't seem to figure out why this is happening.
Here is the code from the header.php after the closing head tag:
<body <?php body_class(); ?>>
<div id="main"><!-- this encompasses the entire Web site -->
<header id="header">
<div class="grid">
<div class="row">
<div class="c3">
<div class="logo">
<?php if(of_get_option('logo_type') == 'text_logo'){?>
<?php if( is_front_page() || is_home() || is_404() ) { ?>
<h1><?php bloginfo('name'); ?></h1>
<?php } else { ?>
<h2><?php bloginfo('name'); ?></h2>
<?php } ?>
<?php } else { ?>
<?php if(of_get_option('logo_url') != ''){ ?>
<img src="<?php echo of_get_option('logo_url', "" ); ?>" alt="<?php bloginfo('name'); ?>" title="<?php bloginfo('description'); ?>">
<?php } else { ?>
<img src="<?php bloginfo('template_url'); ?>/images/logo.png" alt="<?php bloginfo('name'); ?>" title="<?php bloginfo('description'); ?>">
<?php } ?>
<?php } ?>
</div><!-- .logo -->
</div><!-- .c3 -->
<div class="c8">
<nav class="primary">
<div class="menu-holder">
<div class="menu-left">
<div class="menu-right">
<?php wp_nav_menu( array(
'container' => 'ul',
'menu_class' => 'sf-menu',
'menu_id' => 'topnav',
'depth' => 0,
'theme_location' => 'header_menu'
));
?>
</div><!--.menu-right-->
</div><!--.menu-left-->
</div><!--.menu-holder-->
</nav><!--.primary-->
</div><!--.c8-->
<div class="c1 end">
<div id="rss-feed">
<img src="/images/rss-logo.png">
</div><!--.rss-feed-->
</div><!-- .c1 end-->
</div><!-- .row -->
<div class="row">
<div class="c8">
<div class="title">
<img src="/images/title.png">
</div><!--.title-->
</div><!--.c8-->
<div class="c4 end">
<div id="widget-header">
<?php if ( ! dynamic_sidebar( 'Header' ) ) : ?>
<!-- Widgetized Header -->
<?php endif ?>
</div><!--#widget-header-->
</div><!-- .c4 end -->
</div><!-- .row -->
<!--.grid left open-->
</header>
<!--#main left open-->
Let me know if more code/info is needed to answer this question.
Your comments say <!--.grid left open-->, does this mean you want to close the div.grid element after the closing </header>? If so, you can't do that because the div was opened inside the header, so it must be closed before the header is closed. HTML elements can't "overlap" each other.
If you're using Chrome developer tools or similar to inspect the markup, the browser will have seen the error and "fixed" your HTML structure in order to display it.
You either need to put the opening div before or after the header, or close the div before the end of the header.
Related
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;
}
I'm trying to remove the featured image at the top of this blog post wordpress template. The author did a great job, but just left the blog pretty bad. I still need the featured images for thumbnails, however on this page it's a real mess. I'd like the video to sit right under the banner up top. I took out a bunch of stuff and messed it up. I researched about using the class functions, another solution talked about editing the single.php file. After looking through the single.php file, I concluded that everything that i wanted to remove appears to be located in a file called content.php.
so, here's the link: http://beautynetworkeffect.com/ground-zero-hong-kong-fashion-extravaganza-2015-fashion-one/
and here's the code:
<?php
/**
* The default template for displaying content
*
* Used for both single and index/archive/search.
*
* #package WordPress
* #subpackage Javo_Directory
* #since Javo Themes 1.0
*/
global $wp_query;
$javo_author = new WP_User( get_the_author_meta( 'ID' ) ); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?> class="row">
<?php if ( is_sticky() && is_home() && ! is_paged() ) : ?>
<div class="featured-post">
<?php _e( 'Featured post', 'javo_fr' ); ?>
</div>
<?php endif; ?>
<div class="row">
<div class="col-md-12">
<header class="entry-header text-center">
<?php the_post_thumbnail('full', Array('class' => 'img-responsive')); ?>
<div class="label-ribbon-row {f}">
<div class="label-info-ribbon-row-wrapper">
<div class="label-info-ribbon-row">
<div class="ribbons" id="ribbon-15">
<div class="ribbon-wrap">
<div class="content">
<div class="ribbon">
<span class="ribbon-span">
<?php echo get_the_date( 'M d Y'); ?>
</span>
</div>
</div><!-- /.content -->
</div><!-- /.ribbon-wrap -->
</div><!-- /.ribbons -->
</div><!-- /.label-info-ribbon -->
</div><!-- /.ribbon-wrapper -->
</div><!-- /.label-ribbon -->
</header><!-- .entry-header -->
</div><!-- col-md-4 -->
</div>
<div class="row entry-author-info-wrap">
<div class="col-md-2 col-xs-2 entry-author-image">
<a>
<div class="javo-thb" style="width:80px; height:80px; background-image:url('<?php echo apply_filters( 'javo_load_attach_image', $javo_author->avatar );?>');"></div>
</a>
</div>
<div class="col-md-10 col-xs-10 entry-author-meta-wrap">
<div class="entry-author-name"><?php echo $javo_author->display_name; ?></div>
<div class="entry-author-social">
<div class="entry-author-category">
<i class="fa fa-bookmark-o"></i>
<?php the_category( ', ' ); ?>
</div>
<?php if( comments_open() ) : ?>
<div class="pull-left" style="margin:0 10px;">
<span class="separator">/</span>
</div>
<div class="entry-author-comment">
<i class="fa fa-comments-o"></i>
<?php
comments_popup_link(
__( '0 Comment', 'javo_fr' )
, __( '1 Comment', 'javo_fr' )
, __( '% Comments', 'javo_fr' )
); ?>
</div>
<?php endif; // comments_open() ?>
</div>
</div>
</div><!--row entry-author-info-wrap-->
<div class="row entry-description-wrap">
<div class="col-md-12 entry-description">
<?php if ( is_single() ) : ?>
<h1 class="entry-title"><?php the_title(); ?></h1>
<div class="single-post-meta row">
<div class="col-md-10 post-meta-infor">
</div> <!-- col-md-10 -->
<div class="col-md-2 text-right post-social">
<span class="javo-sns-wrap social-wrap">
<i class="sns-facebook" data-title="<?php the_title();?>" data-url="<?php the_permalink();?>">
<a class="facebook javo-tooltip" title="<?php _e('Share Facebook', 'javo_fr');?>"></a>
</i>
<i class="sns-twitter" data-title="<?php the_title();?>" data-url="<?php the_permalink();?>">
<a class="twitter javo-tooltip" title="<?php _e('Share Twitter', 'javo_fr');?>"></a>
</i>
</span>
</div> <!-- col-md-2-->
</div> <!-- single-post-meta -->
<?php else : ?>
<h1 class="entry-title">
<?php the_title(); ?>
</h1>
<?php endif; // is_single() ?>
<?php if ( is_search() ) : // Only display Excerpts for Search ?>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
<?php else : ?>
<div class="entry-content">
<?php
if( is_category() )
{
printf('%s', get_permalink(), javo_str_cut( get_the_excerpt(), 300));
}else{
the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'javo_fr' ) );
} ?>
<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'javo_fr' ), 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<?php endif; ?>
</div><!-- 12 Columns Close -->
</div><!-- Row Close -->
<footer class="entry-meta">
<div class="inner-footer">
<div class="inner-footer-more">
<a href="<?php the_permalink(); ?>">
<?php _e( "more", 'javo_fr' ); ?>
</a>
</div>
<?php //javo_drt_entry_meta(); ?>
<?php edit_post_link( "<i class=\"fa fa-cog\"></i>" . __( 'Edit', 'javo_fr' ), '<span class="edit-link">', '</span>' ); ?>
<?php if ( is_singular() && get_the_author_meta( 'description' ) && is_multi_author() ) : // If a user has filled out their description and this is a multi-author blog, show a bio on their entries. ?>
<div class="author-info">
<div class="author-avatar">
<?php
/** This filter is documented in author.php */
$author_bio_avatar_size = apply_filters( 'javo_drt_author_bio_avatar_size', 68 );
echo get_avatar( get_the_author_meta( 'user_email' ), $author_bio_avatar_size );
?>
</div><!-- .author-avatar -->
<div class="author-description">
<h2><?php printf( __( 'About %s', 'javo_fr' ), get_the_author() ); ?></h2>
<p><?php the_author_meta( 'description' ); ?></p>
<div class="author-link">
<a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author">
<?php printf( __( 'View all posts by %s <span class="meta-nav">→</span>', 'javo_fr' ), get_the_author() ); ?>
</a>
</div><!-- .author-link -->
</div><!-- .author-description -->
</div><!-- .author-info -->
<?php endif; ?>
</div>
</footer><!-- .entry-meta -->
</article><!-- #post -->
To only remove the featured image you have to remove or comment the "the_post_thumbnail" line:
<?php // the_post_thumbnail('full', Array('class' => 'img-responsive')); ?>
To remove the featured image and the date ribbon remove all those lines:
<div class="row">
<div class="col-md-12">
<header class="entry-header text-center">
<?php the_post_thumbnail('full', Array('class' => 'img-responsive')); ?>
<div class="label-ribbon-row {f}">
<div class="label-info-ribbon-row-wrapper">
<div class="label-info-ribbon-row">
<div class="ribbons" id="ribbon-15">
<div class="ribbon-wrap">
<div class="content">
<div class="ribbon">
<span class="ribbon-span">
<?php echo get_the_date( 'M d Y'); ?>
</span>
</div>
</div><!-- /.content -->
</div><!-- /.ribbon-wrap -->
</div><!-- /.ribbons -->
</div><!-- /.label-info-ribbon -->
</div><!-- /.ribbon-wrapper -->
</div><!-- /.label-ribbon -->
</header><!-- .entry-header -->
</div><!-- col-md-4 -->
</div>
Remember that all changes will be overwritten when you update the theme to a new version. A good option to avoid this is to create a Child Theme, the recommended way of modifying an existing theme. More information can be found at: https://codex.wordpress.org/Child_Themes
Test it and let me know if you have any problem.
Regards.
I am gonna add something here since it can be helpful for those who are willing to learn about Wordpress file Content.php.
This file is how wordpress generates post content on wordpress.
It can easily be understood by this code
if ( is_single() ) {
the_title( '<h1 class="entry-title">', '</h1>' );
} elseif ( is_front_page() && is_home() ) {
the_title( '<h3 class="123123">', '</h3>' );
} else {
the_title( '<h2 class="entry-title">', '</h2>' );
}
?>
It shows different content on the base of the page that is being requested.
I'm not sure if I should post this in wordpress stack but if you go to the single.php
on my custom wordpress theme, you'll see that if you make your browser roughly less than 1200 pixels wide, you are able to horizontally scroll to the right. There should be no extra space to allow the horizontal scroll as the page content is in a wrapper div.
I have viewed the source and it appears that the content generated by wordpress through the_content() is creating divs that break the wrapper?
Here is the code for single.php Once again when I remove <?php the_content(); ?> the structural problem is not there.
<?php get_header(); ?>
<div class="page-section clear">
<!-- post thumbnail -->
<div class="single-image-anchor">
<?php if (has_post_thumbnail( $post->ID ) ): ?>
<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); ?>
<a class="single-image" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" style="background-image: url('<?php echo $image[0]; ?>')">
</a>
<?php endif; ?>
</div>
<!-- /post thumbnail -->
<div class="container clear">
<main role="main">
<!-- section -->
<section>
<?php if (have_posts()): while (have_posts()) : the_post(); ?>
<div class="wrapper">
<!-- article -->
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<!-- post title -->
<h1 class="single-title">
<?php the_title(); ?>
</h1>
<!-- /post title -->
<!-- post details -->
<span class="single-date"><?php the_time(get_option('date_format')); ?></span>
<div class="single-text">
<?php the_content(); ?>
<br />
<a href="<?php echo get_permalink(18); ?>" class="back-article">
<i class="fa fa-arrow-circle-left"></i> News
</a/>
</div>
</article>
<!-- /article -->
</div>
<?php endwhile; ?>
<?php else: ?>
<?php endif; ?>
</section>
<!-- /section -->
</main>
</div>
</div>
<?php get_footer(); ?>
it's the facebook share buttons. The span wrapping it and the iframe are currently set to a width of 900px:
<span style="vertical-align: bottom; width: 900px; height: 25px;">
<iframe name="f2a1624528" width="900px" height="1000px" frameborder="0" allowtransparency="true" scrolling="no" title="fb:like Facebook Social Plugin" src="http://www.facebook.com/plugins/like.php?app_id=1526849080927795&channel=http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter%2F7r8gQb8MIqE.js%3Fversion%3D41%23cb%3Dfa87d2a78%26domain%3Dmichaeljeromeinprogress.themichaelsanger.com%26origin%3Dhttp%253A%252F%252Fmichaeljeromeinprogress.themichaelsanger.com%252Ff291a9dcc8%26relation%3Dparent.parent&href=http%3A%2F%2Fmichaeljeromeinprogress.themichaelsanger.com%2Fnye-bte-shows-on-sale-now%2F&locale=en_US&ref=below-post&sdk=joey&share=true&width=900" style="border: none; visibility: visible; width: 900px; height: 25px;" class=""></iframe>
</span>
set them to like 100px since those buttons are small anyways.
Whenever you get problems like this, do this:
div { border: 1px solid red }
Then look at all the div blocks inside the page. Take note on the one's that are touching the right edge.
If you go into Chrome, you can delete the element node. When I deleted the fb social plugin nodes, the horizontal scroll bar went away. So look into that...
I am trying to style a div that is nested in some ofter divs and having some trouble. Below is the code and css I am attempting to use. If you could show me the correct css tag to style the element called #cleanse I would appreciate it.
<!-- Header starts here -->
<header id="header">
<div class="align">
<!-- Logo start here -->
<div id="logo">
<?php if(get_option( 'ms_plain_logo')=="true" ) { ?>
<h1><a class="text_logo" href="<?php echo home_url( '/' ); ?>" data-rel="home"><?php echo get_bloginfo('name'); ?></a></h1>
<?php } else { ?>
<h1><a class="img_logo" href="<?php echo home_url( '/' ); ?>" data-rel="home"></a></h1>
<?php } ?>
</div>
<!-- Logo ends here -->
<!-- Navbar -->
<?php $args=array(
'theme_location'=>'primary-navigation',
'container' => 'nav',
'container_id' => 'navigation-wrapper',
'menu_id' => 'navigation',
'fallback_cb' => false
); ?>
<?php wp_nav_menu($args); ?>
<?php if(!has_nav_menu( 'primary-navigation')) { ?>
<nav id="navigation-wrapper">
<ul id="navigation">
<?php wp_list_pages( 'title_li=&sort_column=menu_order'); ?>
</ul>
</nav>
<?php } ?>
<!-- Navbar ends here -->
<div id="cleanse">
<a href="link" target="_blank">
<img src="img"/></a>
</div>
</div>
</header>
<!-- Header ends here -->
#cleanse { top: 55px; }
What do want to do? Add a margin-top or something?
This only works with position:
#cleanse { top: 55px; }
Try this:
#cleanse { margin-top: 55px; }
Also the css should be placed in the header:
<style>
/* your rules here */
</style>
I have two meny=u bar in my site. 1st- top menu 2nd- primary menu.Top Menubar not working in my site.I input it from menu but not working. I use hostme theme. My site http://www.dewdropzone.asia . My topmenu bar header code. See this theme demo for understand what top menu bar not show my site . click here
<?php if(get_option("topblackmenu") == "true") { ?>
<div class="topmenu">
<div class="inner">
<!-- .top_menu -->
<?php if (has_nav_menu( 'top-menu' ) ) { wp_menu_functon(); }?>
</div>
</div>
<!-- .top_menu -->
<?php } ?>
<div class="clear"></div>
<div id="header">
<div class="inner">
<!-- logo -->
<div class="logo">
<?php if($s_logo){ ?>
<a href="<?php echo get_option('home'); ?>" title="<?php bloginfo('name'); ?>">
<img src="<?php echo $s_logo; ?>" alt="<?php bloginfo('name'); ?>" />
</a>
<?php } else { ?>
<a href="<?php echo get_option('home'); ?>" title="<?php bloginfo('name'); ?>">
<img src="<?php bloginfo('template_url'); ?>/images/logo.png" alt="<?php bloginfo('name'); ?>" />
</a>
<?php } ?>
</div>
<!-- logo -->
<div class="sec-menu">
<?php if (has_nav_menu( 'primary-menu' ) ) { wp_primary_menu_functon(); }
else{
echo('<ul class="nav"><li>'.__('Go to WP-admin Appearance Menus and assign menu location', 'hostme_front').'</li></ul>');
} ?>
</div>
<!-- topmenu -->
</div>
</div><!-- topbar -->
<div class="clear"></div>
I'm sorry for adding an answer, but I don't see an option to comment in the question. Am I missing something?
Did you create your navigation through the Appearance>Menus in your Dashboard?
Make sure that you select the menu you have created as your 'Header Menu'.