Good day everyone.
Just started working in Firm that has given me task to optimize their website (nigeria-friends(dot)com/staging.academix) responsively, which I have been doing gradually and am not all that proficient with PHP, HTML and CSS. But, I can confidently read and understand some couple of stuff in them. Thus;
I have been trying to center all the contents on the frontpage image banner
Reveal or make a particular button "How Academix can benefit you" appear on mobile devices of max-width:380px with no success and that has got me perplexed.
I have searched all through the CSS and couldn't get my head around any to fix it. Hence, me calling for help. And having looked into the index.html from the based folder I found something, the aforementioned buttons were in a loop sort of, which I don't understand.
Here is the index code:
<div class="col-sm-12 col-xs-10 col-centered">
<?php if(!isset($_SESSION["acc_identifier"])){ ?>
<!--
<div class="col-sm-4 col-centered">
<a href="<?php echo $URLMAIN; ?>/access/signup.html">
<div id="fb-login" class="social-login">
<div class="social-text">Sign up for free</div>
</div>
</a>
</div>
-->
<div class="col-sm-6 col-centered">
<a href="<?php echo $URLMAIN; ?>/about/benefits.html">
<div id="yahoo-login" class="social-login">
<div class="social-text">How <?php echo $web_shortName; ?> can benefit you</div>
</div>
</a>
</div>
<div class="col-sm-6 col-centered">
<a href="<?php echo $URLMAIN; ?>/access/host.html">
<div id="g-login" class="social-login">
<div class="social-text">Host your journal on <?php echo $web_shortName; ?></div>
</div>
</a>
</div>
<?php }else{ ?>
<div class="col-sm-6 col-centered">
<a href="<?php echo $URLMAIN; ?>/about/benefits.html">
<div id="yahoo-login" class="social-login">
<div class="social-text">How <?php echo $web_shortName; ?> can benefit you</div>
</div>
</a>
</div>
<div class="col-sm-6 col-centered">
<a href="<?php echo $URLMAIN; ?>/access/host.html">
<div id="g-login" class="social-login">
<div class="social-text">Host your journal on <?php echo $web_shortName; ?></div>
</div>
</a>
</div>
<?php } ?>
</div>
I can't paste in all the index.html code here as is quite long and length, which is generating error format when I try to, which is mixed php and html, where PHP starts the index.html. So also is the CSS file.
#media (min-width: 380px){
#yahoo-login .social-text {
display: none;
}
}
OR
#media (max-width: 380px){
#yahoo-login .social-text {
display: block;
}
}
Related
i have a website in which i used carousel sliders to display images and its values, I have 3 carousel in my homepage, 3 of them have same code, however the first carousel is not displaying name and price like the 2nd and 3rd carousel:
as you can see in the image
the code for this carousel is below:
<section class="carousel_sec">
<div class="container">
<div class="row ">
<h3 class="carousel_heading">Trending Birthday Cakes <button class="pull-right"><span>VIEW ALL</span><!-- <span class="visible-xs">>></span> --></button></h3>
<hr>
<div class="carou">
<div class="demo">
<ul id="landing_products1">
<?php foreach($trending_products1 as $key=>$val) { ?>
<li>
<div class="item">
<div class="pad15 content_div">
<div class="carou_thumb">
<img class="st_img" src="<?php echo ADMIN_IMG.'cakes/'.$val['image'][0]['cake_image'];?>" alt="<?php echo $val['cake_name']; ?>" />
<img class="nd_img" src="<?php echo ADMIN_IMG.'cakes/'.$val['image'][0]['cake_image'];?>" alt="<?php echo $val['cake_name']; ?>" />
<p>
<?php echo $val['cake_name']; ?>
</p>
<?php
$btp_price=0;$offer_price=0;
$btp_price=$val['price'][0]['btp_price'];
$offer_price=$val['price'][0]['offer_price'];
?>
<div class="price text-center" style="width:100%;float:left;">
<span class="amount" style="color:#f2136e;font-size:14px;">
<?php echo PRICE_UNIT;?><?php echo $offer_price;?>
</span> (
<s> <?php echo $btp_price;?></s>)
<span> </span>
<br>
</div>
<!--<br><span><?php echo PRICE_UNIT;100; ?></span></p>-->
</div>
</div>
</div>
</li>
<?php } ?>
</ul>
</div>
</div>
</div>
</div>
</section>
<?php } ?>
while inspecting in browser the value is showing, the live URL is enter link description here
can anyone please tell me what could be wrong here, thanks in advance
You'll need to tweak the css to reveal the content that is hidden.
To push you in the direction, see the improvement with:
#landing_products1 {
height: 330px;
margin-top: -65px;
}
I don't know how responsive you need to be with your UI, so let's call this a temporary fix. The first carousel's dimensions don't perfectly match the others, so I'll leave the fine tuning to you.
It also appears that you have some js and css issues to mop up.
I have panel where I'm displaying some basic informations about user. I want to display graph in the center of this panel.
I have problems with one unwanted space which I want to remove but I don't know how to do it.
Please look at image:
Code for this panel:
<div class="row">
<div class="panel panel-default">
<div class="panel-heading">Detail zákazníka </div>
<div class="panel-body">
<div class="form-group">
<label>ID zákazníka:</label>
<p><?php echo !empty($zakaznici['ID_zakaznici'])?$zakaznici['ID_zakaznici']:''; ?></p>
</div>
<div class="form-group">
<label>Meno:</label>
<p><?php echo !empty($zakaznici['meno'])?$zakaznici['meno']:''; ?></p>
</div>
<div class="panel-body" align="center">Graph will be displayed here</div>
<div class="form-group">
<label>Priezvisko:</label>
<p><?php echo !empty($zakaznici['priezvisko'])?$zakaznici['priezvisko']:''; ?></p>
</div>
<div class="form-group">
<label>Email:</label>
<p><?php echo !empty($zakaznici['email'])?$zakaznici['email']:''; ?></p>
</div>
<div class="form-group">
<label>Adresa:</label>
<p><?php echo !empty($zakaznici['adresa'])?$zakaznici['adresa']:''; ?></p>
</div>
<a class="btn btn-primary" href="<?php echo site_url('Zakaznici/viewusersvypozicky/'.$zakaznici['ID_zakaznici']); ?>" role="button">Zobraziť prenájmy</a>
</div>
</div>
</div>
p tags create line breaks. You could replace the p tag with a span tag to remove the unwanted break.
Your div with the class name 'panel-body' is also occupying space. You could add position: absolute; to its defined styles and it would not create that break.
<div class="row">
<div class="panel panel-default">
<div class="panel-heading">Detail zákazníka </div>
<div class="panel-body">
<div class="form-group">
<label>ID zákazníka:</label>
<p><?php echo !empty($zakaznici['ID_zakaznici'])?$zakaznici['ID_zakaznici']:''; ?></p>
</div>
<div class="form-group">
<label>Meno:</label>
<span><?php echo !empty($zakaznici['meno'])?$zakaznici['meno']:''; ?></span>
</div>
<div class="panel-body" align="center">Graph will be displayed here</div>
<div class="form-group">
<label>Priezvisko:</label>
<p><?php echo !empty($zakaznici['priezvisko'])?$zakaznici['priezvisko']:''; ?></p>
</div>
<div class="form-group">
<label>Email:</label>
<p><?php echo !empty($zakaznici['email'])?$zakaznici['email']:''; ?></p>
</div>
<div class="form-group">
<label>Adresa:</label>
<p><?php echo !empty($zakaznici['adresa'])?$zakaznici['adresa']:''; ?></p>
</div>
<a class="btn btn-primary" href="<?php echo site_url('Zakaznici/viewusersvypozicky/'.$zakaznici['ID_zakaznici']); ?>" role="button">Zobraziť prenájmy</a>
</div>
</div>
</div>
Try this
<div class = "row">
<div class = "panel panel-default col-4">
<div class = "panel-body">
//your matter
</div>
</div>
<div class = "panel panel-default col-4">
<div class = "panel-body">
//your graph
</div>
</div>
</div>
As discussed the p's are block level elements and create linebreaks - but Bootstrap also stlyes them with a 10px margin bottom so you may want to overwrite that with
p { margin-bottom: 0;}
I do not recommend this - the ideaa of the margin bottom is to separate text elements.
What will be causing your space issue where you have indicated is that you are using a div with a .panel body class within the panel body.
<div class="panel-body" align="center">Graph will be displayed here</div>
Bootstrap styles the panel body with 15px padding - so either
a) replace that class with a different class (this is what I would do - it makes no sense to have a .panel-body -within a .panel-body)
b) remove the padding from the nested panel body
.panel-body > .panel-body { padding: 0}
But as I said - a panel body within another one is semantically wrong.
PHP contact form is sent and displays a confirmation message: I need the div with the white background to be full column. If I put margins on the message, it breaks layout as pictured. I'm still wrapping my head around how the PHP logic's structure in terms of interactions, not sure where exactly to tweak it and fix the issue.
My code is structured as such:
<div id="whitebox" class="whitebox">
<div class="text-center orange-navbar">
<nav role="navigation">
<ul class="navcen nav nav-pills" >
<li role="presentation">Home</li>
<li role="presentation">Portfolio</li>
<li class="active" role="presentation">Contact</li>
</ul>
</nav>
</div>
<?php if(!empty($emailSent)): ?>
<div class="col-md-6 col-md-offset-3">
<div class="alert alert-success text-center"><?php echo $config->get('messages.success'); ?></div>
</div>
<?php else: ?>
<?php if(!empty($hasError)): ?>
<div class="col-md-5 col-md-offset-4">
<div class="alert alert-danger text-center"><?php echo $config->get('messages.error'); ?></div>
</div>
<?php endif; ?>
Add this to your css:
.whitebox {
height: 100vh;
}
This will give your whitebox div a height of 100% of your viewport.
OK, this is a bit complicated so Ill try my best to explain it:
I have a while loop which has a next link, before I just had it in standard html, so it was farely simple, on click of the class 'arrow' it would just to the next section e.g:
$i = 0;
while ( have_rows('sections') ) : the_row();
$sectionName = $i++;
?>
<section id="<?php echo $sectionName; ?>" class="full-bg-image" style="background-image: url('<?php the_sub_field('section_image'); ?>')">
<div class="image divider" id="partnersImg" style="background-image: url('<?php the_sub_field('section_image'); ?>')">
<div class="wrapper">
<div class="overlay" style="color: <?php the_field('section_text_colour','options'); ?>">
<?php the_sub_field('divider_text'); ?>
</div>
</div>
</div>
<div class="sectionContent">
<div class="wrapper">
<div class="centerContent">
<div class="contentWrapper">
<div class="text animation-element" data-sr="enter center wait 0.5s, no reset" style="background-color: <?php the_field('text_block_bg_colour','options'); ?>; color: <?php the_field('text_block_text_colour','options'); ?>">
<?php the_sub_field('section_text'); ?>
<div class="arrowContainer"></div>
</div>
<div class="clr"></div>
</div>
</div>
</div>
</div>
</section>
<?php endwhile;
The sectionName variable is set for each item name that is added in the wordpress admin however the issue comes when my above code shows and the anchor is linking too itself and not the next section, I would like to know how to link it to the next section and if its the last section then to have a anchor which links to the first.
<section id="0">
<div class="arrowContainer"></div>
</section>
<section id="1">
<div class="arrowContainer"></div>
</section>
<section id="2">
<div class="arrowContainer"></div>
</section>
<section id="3">
<div class="arrowContainer"></div>
</section>
In this case I am using Advanced Custom Fields repeater and not posts.
In master Layout I am trying to do like this
<div class="carousel-inner">
<div class="item active">
{{HTML::image('#yield('image0')','#yield('alt0')')}}
<div class="carousel-caption">
</div>
</div>
<div class="item">
{{HTML::image('#yield('image1')','#yield('alt1')')}}
<div class="carousel-caption">
</div>
<div class="item">
{{HTML::image('#yield('image2')','#yield('alt2')')}}
<div class="carousel-caption">
</div>
<div class="item">
{{HTML::image('#yield('image3')','#yield('alt3')')}}
<div class="carousel-caption">
</div>
<div class="item">
{{HTML::image('#yield('image4')','#yield('alt4')')}}
<div class="carousel-caption">
</div>
</div>
<div class="item">
{{HTML::image('#yield('image5')','#yield('alt5')')}}
<div class="carousel-caption">
</div>
</div>
In Page
#extends('tours/toursMaster')
#section('title','Some title')
#section('image0','assets/IG_101/IG1011.jpg')
.......
................
But the error I am encountering is
syntax error, unexpected 'image0' (T_STRING)
<li data-target="#carousel-example-generic" data-slide-to="4"></li>
<li data-target="#carousel-example-generic" data-slide-to="5"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<?php echo HTML::image('<?php echo $__env->yieldContent('image0'); ?>','<?php echo $__env->yieldContent('alt0'); ?>'); ?>
<div class="carousel-caption">
Note :I am using Codesleeve asset pipeline
and my Images are in respective folders..
You've an error in the HTML::image(
You can solve this:
<?php echo HTML::image($__env->yieldContent('image0'),$__env->yieldContent('alt0')); ?>
Hope this will work for you.
You can't echo some content into an php function. If you want to print something to the browser then you've to use functions like print, echo or (s)printf. But in this case you would like to pass some content to a php function and not to the user. So therefore you've to give a reference to a existing variable to the HTML::image method. So you only have to use echo or something like that if you want to print that. In this case you only wants to print the HTML::image(...); result.
Hope its clear for you!