I'm trying to update our mobile site over the last week but I'm hitting an issue with the footer. It loads up just fine on the home page but crashes when on a normal page. Both are using the same footer.php file.
The staging site that I'm working on is:
http://premierdism.staging.wpengine.com/
<?php
/**
* The template for displaying the footer.
*
*/
?> <div class="clearfix"></div>
</div><!-- .site_content .inner-wrapper -->
</div><!-- .site_content -->
<?php if(!is_front_page()):?>
<?php if(!is_page(52)):?>
<div class="page-cta">
<h4 style="font-family: Georgia;font-size: 40px !important; font-weight: bold; color: #075aa0;">Free, No Obligation</h4>
<h5 style="font-size: 40px !important; font-weight: 500; line-height: .6 !important; margin-top: 0px; color: #075aa0;;">Disability Evalution</h5>
<hr style="border-top: 1px solid #39393b; width:90%;">
<p style="font-size: 30px !important;">Let us help you determine if you<br>qualify for disability income<p>
<div style="height:20px;"></div>
<a title="Free social Security Evaluation" href="http://premierdism.staging.wpengine.com/contact-us/free-evaluation/">Free Evaluation</a>
</div>
<?php endif;?>
<img src="http://premierdism.staging.wpengine.com/wp-content/uploads/2016/09/Premier_Bottom_Logos.png" />
<?php else:?>
<div class="home-map">
<div class="inner-wrapper">
<?php
$args = array(
'numberposts' => -1,
'post_parent' => 56,
'post_type' => 'page',
'orderby' => 'title',
'order' => 'ASC'
);
$children = get_children( $args );
?>
<?php if($children):?>
<div class="state-list">
<p style="align:left; Color:#a32a2f; margin-bottom:0px;"><b>Click the map below<br>for more state information</b></p>
<hr style="margin-top: 0px; margin-bottom: 0px; margin-right: 0px; width: 570px; border-top: 2px solid #a32a2f;" />
<p align="left">All 50 states and territories</p>
<a href="https://m.premierdisability.com/the-premier-difference/nationwide-disability-benefits/"><img src="http://premierdism.staging.wpengine.com/wp-content/uploads/2016/09/Premier_Map.svg" alt="Premier Disability offers nationwide help"/>
<div class="clearfix"></div>
</div>
<?php endif;?>
</div>
</div>
<?php endif;?>
<div class="clearfix"></div>
<div class="site-footer">
<div class="footer-disclamier">
<div class="inner-back">
<div class="inner-wrapper" style="background-color: #e3e3e3; width: 640px; margin: -20px 0px 0px -40px; padding: 20px 0px;">
<p class="sharelink">Keep in touch</p>
<div style="padding-bottom:80px;" class="social relative">
<div style="position: absolute; left: 20%;">
<a class="block left" href="https://www.facebook.com/PremierDisability" target="_blank"><img src="http://premierdism.staging.wpengine.com/wp-content/uploads/2016/09/Facebook-Icon.jpg" style="width:60px;"></a>
<a class="block left" href="https://plus.google.com/110325482012270783070" target="_blank"><img src="https://m.premierdisability.com/wp-content/uploads/2016/09/GooglePlus-Icon.png" style="width:60px;"></a>
<a class="block left" href="https://twitter.com/PremierDisSvcs" target="_blank"><img src="https://m.premierdisability.com/wp-content/uploads/2016/09/Twitter-Icon.png" style="width:60px;"></a>
<a class="block left" href="https://www.instagram.com/premierdisabilityservices/" target="_blank"><img src="https://m.premierdisability.com/wp-content/uploads/2016/09/Instagram-Icon.png" style="width:60px;"></a>
</div>
<div style="padding: 0px 109px; margin-top: 90px;">
<div class="applink Apple"></div>
</div>
</div>
</div>
</div>
<div class="small-disclaimer"><p style="font-size:12px !important;margin-top: 20px;line-height:1.2;"><b>Disclaimer:</b> We are a privately owned, nationwide advocacy service. Any information you receive on this site is not intended to be, nor should it be construed as, legal advice. Using this website or contacting us does not create any type of legal or fiduciary relationship. Premier Disability Services, LLC is neither affiliated with nor endorsed by the Social Security Administration or any other government agency or entity.</p></div>
</div>
</div>
<div class="copyright">
<div class="inner-back">
<div class="inner-wrapper">
<?php Theme::getCopyright()?>
</div>
</div>
</div>
</div><!-- .site-footer -->
</div><!-- #main .wrapper -->
</div><!-- #page -->
<?php wp_footer(); ?>
</body>
</html>
You can change margin-top: 90px to padding-top: 90px, in this spot:
<div style="padding: 0px 109px; margin-top: 90px;">
<a href="https://itunes.apple.com/us/app/premier-ssd/id1143571193?mt=8">
<div class="applink Apple"></div>
</a>
<a href='https://play.google.com/store/apps/details?id=com.goodbarber.premierdis&utm_source=global_co&utm_medium=prtnr&utm_content=Mar2515&utm_campaign=PartBadge&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'>
<div class="applink Google"></div>
</a>
</div>
Try moving the footer php into its own php file. Then simply include the file at the end of the page. I use this and it works.
To do this, take the code from the wp_footer() function and paste it in a new file.
Then include 'new-wp-footer.php'; on pages where it doesn't show up.
Update:
Try to turn on output buffering before you include. Then grab the the contents.
For example,
ob_start();
include('footer.php');
$footer_content = ob_get_clean();
echo $footer_content;
Related
I'm developing a WordPress theme with Bootstrap grids, and I see a problem in mobile view. Everything is fixed into the Bootstrap column, but there are some links in the references section that don't stay inside the column and make a mess of my grids and create a horizontal scroll bar:
I've tried everything and nothing works, please I need help.
Here is the code from the single.php:
<div class="c-content-box c-size-md" style="margin-top:4%;">
<div class="container">
<div class="row">
<div class="c-content-blog-post-card-1-grid">
<div class="row">
<div class="col-md-12">
<div class="col-md-8 wow animate fadeInLeft">
<div class="c-media 2 img">
<div class="c-overlay-wrapper">
<div class="c-overlay-content">
<?php the_post_thumbnail( '', array( 'style' => 'max-width:100%; height:auto;' ) ); ?>
</div>
</div>
</div>
<?php
while ( have_posts() ) : the_post();
get_template_part( 'template-parts/content', get_post_format() );
?>
<div class="col-md-12 c-margin-b-60">
<?php
the_post_navigation( array(
'prev_text' => '<button type="button" class="col-md-5 col-md-offset-1 col-xs-6 btn btn-md c-btn-red c-btn-square ">Post Anterior</button>',
'next_text' => '<button type="button" class="col-md-5 col-md-offset-1 col-xs-6 btn btn-md c-btn-red c-btn-square ">Próximo Post</button>',
));
?>
</div>
<?php
echo '<div class="col-md-12 c-margin-t-20">';
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
endwhile; // End of the loop.
echo '</div>'
?>
</div>
<div class="col-md-4 ">
<div class="col-md-12 wow animate fadeInRight" >
<?php get_sidebar(); ?>
</div>
</div>
</main><!-- #main -->
</div><!-- #primary -->
</div>
</div>
</div>
</div>
</div>
You'll need to add some CSS to word-wrap your text.
div {
width: 100px;
border: 1px solid black;
margin: 5px;
}
.wrapped {
word-wrap: break-word;
}
<div>https://stackoverflow.com/questions/45800283/content-posts-doesnt-stay-inside-the-bootstrap-cols</div>
<div class="wrapped">https://stackoverflow.com/questions/45800283/content-posts-doesnt-stay-inside-the-bootstrap-cols</div>
.dont-break-out {
overflow-wrap: break-word;
word-wrap: break-word;
-ms-word-break: break-all;
word-break: break-all;
word-break: break-word;
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
hyphens: auto;
}
I am using a custom theme for WordPress, and I have an issue with comment formatting. Reply comments show the body before the comment metadata (user name and date). This is strange because in the HTML the body is clearly after the metadata.
The following is the HTML code as produced by Wordpress:
<div class="comment-list">
<div id="comment-4" class="comment even thread-even depth-1 parent">
<article id="div-comment-4" class="comment-body">
<footer class="comment-meta">
<div class="comment-author vcard">
<b class="fn">John Seibert</b> <span class="says">says:</span>
</div><!-- .comment-author -->
<div class="comment-metadata">
<a href="http://howtolearnalanguagelikeaboss.com/introduction/#comment-4">
<time datetime="2015-12-08T01:40:19+00:00">December 8, 2015 at 1:40 am</time>
</a>
<span class="edit-link"><a class="comment-edit-link" href="http://howtolearnalanguagelikeaboss.com/wp-admin/comment.php?action=editcomment&c=4">Edit</a></span>
</div><!-- .comment-metadata -->
</footer><!-- .comment-meta -->
<div class="comment-content">
<p>Hi Dave,</p>
<p>Nice web site.</p>
<p>Dad</p>
</div><!-- .comment-content -->
<div class="reply"><a rel='nofollow' class='comment-reply-link' href='http://howtolearnalanguagelikeaboss.com/introduction/?replytocom=4#respond' onclick='return addComment.moveForm( "div-comment-4", "4", "respond", "6" )' aria-label='Reply to John Seibert'>Reply</a></div>
</article><!-- .comment-body -->
<div id="comment-7" class="comment odd alt depth-2">
<article id="div-comment-7" class="comment-body">
<footer class="comment-meta">
<div class="comment-author vcard">
<b class="fn">Dave Seibert</b> <span class="says">says:</span>
</div><!-- .comment-author -->
<div class="comment-metadata">
<a href="http://howtolearnalanguagelikeaboss.com/introduction/#comment-7">
<time datetime="2015-12-31T21:42:56+00:00"> December 31, 2015 at 9:42 pm </time>
</a>
</div><!-- .comment-metadata -->
</footer><!-- .comment-meta -->
<div class="comment-content">
<p>Thanks, Dad!</p>
</div><!-- .comment-content -->
<div class="reply"><a rel='nofollow' class='comment-reply-link' href='http://howtolearnalanguagelikeaboss.com/introduction/?replytocom=7#respond' onclick='return addComment.moveForm( "div-comment-7", "7", "respond", "6" )' aria-label='Reply to Dave Seibert'>Reply</a></div>
</article><!-- .comment-body -->
</div><!-- #comment-## -->
</div><!-- #comment-## -->
</div><!-- .comment-list -->
Yet this is rendered with with the content "Thanks, Dad!" coming before "Dave says" and the date, as shown here: screenshot of metadata following content.
I realized this might be a floating issue, but the only css I have affecting this section is the following:
.comment-author {
font-size: 1.7rem;
line-height: 2.1rem;
float: left;
}
.comment-metadata {
font-size: 1.7rem;
line-height: 2.1rem;
float: right;
font-weight: 300;
font-style: italic;
}
div.comment {
padding-bottom: 4em;
}
h2.comments-title {
border-style: solid;
border-width: 1px 0 0 0;
margin-top: 2em;
padding-top: .5em;
padding-bottom: 1em;
}
div.reply {
font-size: 1.7rem;
line-height: 2.1rem;
float: right;
border-style: solid;
padding: .1em .3em .1em .3em;
border-width: .1em;
}
Un-floating the .comment-author class does not help, although un-floating the .comment-metadata and div.comment does help, although that changes the design considerably, since then those elements will be left-aligned. Any help would be much appreciated.
You were right in that it was a floating issue, but on the wrong element. Try un-floating .reply. You can fix this with overflow: auto; on the .comment-body class, or by adding a margin to the bottom of each comment.
I'm changing the layout of my "users" page in a Wordpress website here
I would like to limit the numbers of characters of the description to a certain amount, in order to "equalize" the bio of each author (user).
Is it possible?
Here the template code:
<?php
/*
Template Name: Display Contributors and Authors
*/
$args = array(
'role' => 'contributor',
'orderby' => 'post_count',
'order' => 'DESC'
);
$contributors = get_users( $args );
?>
<?php get_header();?>
<div id="main">
<div id="primary" class="three-parts archive">
<div class="widget-title">
<?php the_title(); ?>
</div>
<div id="blog-list" class="blog-category">
<ul>
<?php
foreach($contributors as $contributor)
{
?>
<li style="margin-top: 10px; width:25%;">
<div class="blog-post-image">
<div class="image_fx5">
<a href=<?php echo get_author_posts_url( $contributor->ID ); ?>><?php echo get_avatar( $contributor->user_email, '128' ); ?></a>
</div>
</div>
<!--author-image-->
<div class="blog-post-title-box">
<div class="blog-post-title">
<h2>
<a href=<?php echo get_author_posts_url( $contributor->ID ); ?>><?php echo $contributor->display_name; ?></a>
</h2>
</div>
</div>
<!--author-name-->
<div class="blog-post-content" style="padding-bottom: 0px; text-align: justify;">
<?php echo $contributor->description; ?>
</div>
<div id="author-info" style="margin-top: 0px; padding-left: 0px; padding-right: 0px; border-bottom-width: 0px;">
<div id="author-desc" style="width: 100%;">
<ul class="author-social" style="padding-top: 0px;">
<?php if($contributor->facebook) { ?>
<li style="
margin-top: 0px;
padding-left: 0px;
padding-right: 0px;
height: 25px;
">
<a href="http://facebook.com/<?php echo $contributor->facebook; ?>" class="fb-social-icon" target="_blank">
</a>
</li>
<?php } ?>
<?php if($contributor->twitter) { ?>
<li style="
margin-top: 0px;
padding-left: 0px;
padding-right: 0px;
height: 25px;
">
<a href="https://twitter.com/<?php echo $contributor->twitter; ?>" class="twitter-social-icon" target="_blank">
</a>
</li>
<?php } ?>
<?php if($contributor->google) { ?>
<li style="
margin-top: 0px;
padding-left: 0px;
padding-right: 0px;
height: 25px;
">
<a href="http://plus.google.com/<?php echo $contributor->google; ?>?rel=author" class="google-social-icon" target="_blank">
</a>
</li>
<?php } ?>
<?php if($contributor->pinterest) { ?>
<li style="
margin-top: 0px;
padding-left: 0px;
padding-right: 0px;
height: 25px;
">
<a href="http://www.pinterest.com/<?php echo $contributor->pinterest; ?>?rel=author" class="pinterest-social-icon" target="_blank">
</a>
</li>
<?php } ?>
<?php if($contributor->instagram) { ?>
<li style="
margin-top: 0px;
padding-left: 0px;
padding-right: 0px;
height: 25px;
">
<a href="http://www.instagram.com/<?php echo $contributor->instagram; ?>?rel=author" class="instagram-social-icon" target="_blank">
</a>
</li>
<?php } ?>
</ul>
</div>
</div>
<!--author-desc-->
</li>
<?php } ?>
</ul>
</div>
</div>
<!--primary-->
<div id="secondary">
<?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Category Sidebar')): endif; ?>
</div>
<!--secondary-->
</div>
<!--main-->
<?php get_footer(); ?>
Assuming you mean the description try...
<?php echo substr($contributor->description, 0, strpos($contributor->description, ' ', 150)); ?>
Which will return 150 (you can change this to what you like) characters and also make sure it finishes the last word as well.
I have a problem with my container, it actually overlapping to the header, how do I adjust it in css? It should be under the header with a little margin between header and the container.
see the screenshot here
#myHeader {
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 100;
background-color: YELLOW;
box-shadow: 0px 2px 3px #888888;
height: 150px;
opacity:0.95;
filter:alpha(opacity=10);
}
#myContent {
padding-top: 10px;
}
#myContent .row {
background-color: #fff;
}
#myContent h1{
margin-top: 0;
}
<section id="myContent">
<div class="container">
<div class="row">
<div class="col-sm-8 col-md-8 col-lg-8">
<div>
<br />
<?php if ($breadcrumb): ?>
<div id="breadcrumb"><?php print $breadcrumb; ?></div>
<?php endif; ?>
<?php print $messages; ?>
<div id="content" class="column"><div class="section">
<a id="main-content"></a>
<?php print render($title_prefix); ?>
<?php if ($title): ?><h1 class="title" id="page-title"><?php print $title; ?></h1><?php endif; ?>
<?php print render($title_suffix); ?>
<?php if ($tabs): ?><div class="tabs"><?php print render($tabs); ?></div><?php endif; ?>
<?php print render($page['help']); ?>
<?php if ($action_links): ?><ul class="action-links"><?php print render($action_links); ?></ul><?php endif; ?>
<?php print render($page['content']); ?>
<?php print $feed_icons; ?>
</div></div> <!-- /.section, /#content -->
<?php if($is_front):?>
<h2>MISSION & VISION<br /></h2>
<!-- <img src="<?php print(path_to_theme()); ?>/images/Bottom.jpg" alt="" class="img-thumbnail pull-left" style="margin-right: 10px;" /> -->
<div>
Our company comes to trade few years ago but from beginning we start to do only professional projects.
We our not satisfied with just good result. It needs to be perfect.
<br /><br />
That's why we teach our employers still to make them the best in this region.
Every 2 years we give to our employers test from new technologies to make sure that we are leaders on market.
<br /><br />
There is no excuse for fails. Our standards are so high that for us is every time the first rule quality.
<br /><br />
You can see in photogallery our references but they are more. Our company are in touch with partners like QINT, TSN-D or FinishLine...
<br /><br />
Come to our company take prospects to see if our portfolio fit to your vision and after that we can find the best way
how to realize it TOGETHER!
<br /><br />
</div>
<?php endif; ?>
</div>
</div>
the header should be inside your container and give fixed width you container
here is an example:
.container{ width:100%; max-width:500px; margin:0 auto; position:relative; background-color:yellow; padding-top:100px;}
.header{ width:100%; max-width:500px; margin-left:-250px; left:50%; height:100px; background-color:red; position:fixed; top:0px; text-align:center;}
<div class="container">
<div class="header">Header</div>
This is your container<br/>
This is your container<br/>
This is your container<br/>
This is your container<br/>
This is your container<br/>
This is your container<br/>
</div>
I deppared myself with the same problem here and apparently, I solved it using the following sollution:
style="z-index: 1" for the navbar or header;
style="z-index: 0" for the container;
*Reminder: using the "style" inside your html script instead of a css folder linked to it is deprecated, it will work but its a better practice trying to avoid this.
I have narrowed down the culprit to either a SPAN or a DIV in lines 27-33 but cant quite get it... if i remove the span that makes the font below the press muted, it fixes the spacing issue at the top of the page but makes that text way to large
u.neighborrow.com/items/indexb
<div id="slide_one" class="bg"><!--slide #1-->
<div class="slide-content">
<div class="nhome">
<div style="margin-top:22px;color:#000;font-size:30px;margin-left:200px;width:408px">
The cheaper, greener, easier, better way to have stuff.
<span style="font-size: 13px; position: relative; top: -2px"> <br /></span>
<?php echo $form->create('Item', array('controller' => 'items', 'action' => 'recent/2')); ?>
<div class="input text required">
<label for="ItemItem"></label><input type="text" id="ItemItem" value="" maxlength="255" style="font-size: 25px; width: 200px; margin: 5px 0pt;" name="data[Item][item]">
<input type="submit" value="Search" style="font-size: 22px" />
</div>
<?php echo $form->end(); ?>
<div style="font-size: 13px; position: relative; top: -2px; line-height: 1.4em;"> <strong>Search Tips:</strong> Need a camera or a book for a trip? Want to try an iPAD before you buy it? Need a tool for a project or a tent for an event? <br />
Borrow these things from your neighbors, The <i>owner</i>-ship has SAILED!</div>
<span style="font-weight:normal;color:#ccc;font-size:14px;line-height:20px">Still not sure what to borrow? <br />
Browse the borrowables or <br />
Lend something safely and securely<br />
</span>
<div>
<div style="padding:5px;text-align:center"><img src="/images/press_wide.jpg"></div>
<span style="font-weight:normal;color:#ccc;font-size:14px;line-height:20px"> The media adores us, our users love us,our friends <i>like us</i>,
<center><iframe src="http://www.facebook.com/plugins/like.php?href=www.neighborrow.com&layout=standard&show_faces=false&width=350&action=like&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height: 30px; text-align: center;margin-top:0px;"></iframe></center>
(oh yeah, and mother earth has a crush on us:)</div></span>
<hr color="#CCC" />
</div>
</div>
</div>
</div>
</div>
and i know i need to get rid of the inline styles:)
got some crazy margins:
<div class="main-content" style="margin-top:200px">
It's in div class="main content" style="margin-top: 200px"> It seems to be inline on line 325