So I created a comments section for a WordPress theme I am developing and after a good half hour of trying to figure out what went wrong in the labeling of the styling, I am stumped So the problem is the article.post img styling is affecting the comment-meta img. One should not be affecting the other.
I am also providing what it looks like in Chrome developer tools Elements:
<img alt="" src="http://1.gravatar.com/avatar/4f9ce072cb3fdb377cbb1a083d5c7d1a?s=80&d=mm&r=g" srcset="http://1.gravatar.com/avatar/4f9ce072cb3fdb377cbb1a083d5c7d1a?s=160&d=mm&r=g 2x" class="avatar avatar-80 photo" height="80" width="80">
This is the style.css:
body {
padding-top: 20px;
font-size: 15px;
color: #7a7a7a;
line-height: 1.7em;
}
a {
color: #0faf97;
}
.btn-primary {
background: #0faf97;
color: #fff;
border-color: #fff;
}
.btn-primary:hover {
background: #fff;
color: #0faf97;
}
.container {
max-width: 1020px;
}
.nav-pills > li.active > a,
.nav-pills > li.active > a:hover,
.nav-pills > li.active > a:focus {
background: #0faf97;
}
.jumbotron {
text-align: center;
border-bottom: 1px solid #e5e5e5;
padding-top: 90px;
padding-bottom: 90px;
color: #fff;
}
footer {
padding-top: 19px;
color: #777;
border-top: 1px solid #e5e5e5;
}
.block {
border:#ccc solid 1px;
padding: 20px 20px 30px 20px;
text-align: center;
}
.block h2 {
color: #0faf97;
}
.fa {
color: #0faf97;
}
.fa-3 {
font-size: 4em !important;
}
.marketing {
margin: 40px 0;
}
.content-region-1 {
background: #0faf97;
color: #ffffff;
text-align: center;
}
.content-region-2 {
background: #f4f4f4;
color: #333333;
}
.content-region-3 {
background: #000000;
color: #ffffff;
}
.content-region-2 img {
width: 100%;
}
.content-region-3 h4 {
}
.content-region-1 h1, .content-region-2 h3 {
margin: 0;
padding: 0;
padding-bottom: 15px;
font-size: 40px;
}
.content-region-3 form input[type="text"], .content-region-3 form textarea {
width: 100%;
padding: 5px;
background: #333;
color: #fff;
margin-bottom: 10px;
border: 0;
}
.pt20{padding-top: 20px;}
.pb20{padding-bottom: 20px;}
.pt30{padding-top: 30px;}
.pb30{padding-bottom: 30px;}
.pt40{padding-top: 40px;}
.pb40{padding-bottom: 40px;}
.pt50{padding-top: 50px;}
.pb50{padding-bottom: 50px;}
.pt60{padding-top: 60px;}
.pb60{padding-bottom: 60px;}
.side-widget {
margin-bottom: 40px;
}
.side-widget h3 {
border-left: 5px #0faf97 solid;
padding-left: 10px;
margin-bottom: 15px;
}
.title-bar {
background: #0faf97;
color: #ffffff;
padding-bottom: 10px;
border-bottom: 6px #ddd solid;
margin-bottom: 20px;
}
article.post {
border-bottom: 1px #ccc solid;
overflow: auto;
padding-bottom: 30px;
margin-bottom: 40px;
}
article.post .meta {
border-top: #ccc solid 1px;
border-bottom: #ccc solid 1px;
overflow: auto;
list-style: none;
margin: 0;
padding: 5px 0;
}
article.post .meta li {
float: left;
margin-right: 20px;
}
article.post img {
width:100%;
height: auto;
margin-bottom:20px;
}
.panel-heading {
background: #0faf97 !important;
color: #fff !important
}
.sidebar-widget ul {
padding: 0 !important;
list-style: none;
}
.sidebar-widget li {
position: relative;
display: block;
padding: 10px 15px;
margin-bottom: -1px;
background-color: #fff;
border: 1px solid #ddd;
}
.comments {
border: 1px #ccc solid;
padding: 10px;
margin-bottom: 20px;
margin-top: 10px;
}
.comments h2, .comments h3 {
background: #0faf97;
color: #fff;
padding: 5px;
}
.comment-body {
border: #ccc 1px solid;
margin-bottom:10px;
.comment-meta {
background: #333;
color: #fff;
padding: 10px;
overflow: auto;
}
.comment-meta img {
float: left;
margin-right: 10px;
}
.comment-meta time {
margin-left: 12px;
}
.comment-reply-link {
background: #0faf97;
color: #fff;
display: inline-block;
padding: 10px 15px;
}
.comment-form input, .comment-form textarea {
width: 100%;
padding: 3px;
border: #ccc 1px solid;
margin-bottom: 20px;
}
This is the comments.php file:
<div class="comments">
<h2>Comments</h2>
<?php $args = array(
'walker' => null,
'max_depth' => '',
'style' => 'ul',
'callback' => null,
'end-callback' => null,
'type' => 'all',
'reply_text' => 'Reply',
'page' => '',
'per_page' => '',
'avatar_size' => 80,
'reverse_top_level' => null,
'reverse_children' => '',
'format' => 'html5', // or 'xhtml' if no 'HTML5' theme support
'short_ping' => false, // #since 3.6
'echo' => true // boolean, default is true
);
?>
<?php wp_list_comments($args, $comments); ?>
<?php
$form_args = array(
'label_submit' => 'Send',
'title_reply' => 'Write a Reply or Comment',
'comment_notes_after' => '',
'comment_field' => '<p class="comment-form-comment"><label for="comment">'._x('Comment','noun').'</label><br /><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>',
);
comment_form($form_args);
?>
</div>
When I alter the article.post img css it also affects the avatar image. I can't figure out how to alter that behavior. The avatar image is way too big and I just want to make it thumbnail size.
Here is the single.php file:
<?php get_header(); ?>
<?php if(have_posts()) : ?>
<?php while(have_posts()) : the_post(); ?>
<article class="post">
<section class="row title-bar">
<div class="container">
<div class="col-md-12">
<h1><?php the_title(); ?></h1>
</div>
</div>
</section>
<section class="row main">
<div class="container">
<?php if(is_active_sidebar('sidebar')) : ?>
<div class="col-md-8">
<?php else : ?>
<div class="col-md-12">
<?php endif; ?>
<article class="post">
<div class="post_thumbnail">
<?php if(has_post_thumbnail()): ?>
<?php the_post_thumbnail(); ?>
<?php endif; ?>
</div>
<ul class="meta">
<li>By <?php the_author(); ?></li>
<li><?php the_time('F j, Y g:i a'); ?></li>
<li>
<?php
$categories = get_the_category();
$separator = ", ";
$output = '';
if($categories){
foreach($categories as $category){
$output .= ''.$category->cat_name .''.$separator;
//$output .= $category->cat_name . $separator;
}
}
echo trim($output, $separator);
?>
</li>
</ul>
<br>
<?php the_content(); ?>
</article>
<div class="clr"></div>
<?php endwhile; ?>
<?php endif; ?>
<?php comments_template(); ?>
</div>
<?php if(is_active_sidebar('sidebar')) : ?>
<div class="col-md-4">
<?php dynamic_sidebar('sidebar'); ?>
</div>
<?php endif; ?>
</div>
</section>
<?php if(is_active_sidebar('content-region-1')) : ?>
<?php dynamic_sidebar('content-region-1'); ?>
<?php endif; ?>
<?php if(is_active_sidebar('content-region-2')) : ?>
<?php dynamic_sidebar('content-region-2'); ?>
<?php endif; ?>
<?php get_footer(); ?>
When I alter article.post img it changes the avatar img in comment section, but it also alters the blog images. Not sure that ended up happening. In theory, if I had done this correctly, comment-meta img should be what alters the avatar image. Chrome developer tools outputs this as CSS:
element.style {
}
article.post img {
width: 100%;
height: auto;
margin-bottom: 20px;
}
.comment-meta img {
float: left;
margin-right: 10px;
}
img {
vertical-align: middle;
}
img {
border: 0;
}
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
img[Attributes Style] {
height: 80px;
width: 80px;
}
Inherited from footer.comment-meta
.comment-meta {
background: #333;
color: #fff;
padding: 10px;
overflow: auto;
}
footer {
padding-top: 19px;
color: #777;
border-top: 1px solid #e5e5e5;
user agent stylesheet
li {
display: list-item;
text-align: -webkit-match-parent;
}
Inherited from body.post-template-default.single.single-post.postid-20.single-format-standard.logged-in.admin-bar.wp-custom-logo.customize-support
body {
padding-top: 20px;
font-size: 15px;
color: #7a7a7a;
line-height: 1.7em;
}
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.42857143;
color: #333;
background-color: #fff;
}
Inherited from html
html {
font-size: 10px;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
html {
font-family: sans-serif;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
Pseudo ::before element
*:before, *:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
Pseudo ::after element
*:before, *:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
The article.post img selector targets all images that are inside the article.post element. This includes your avatar images.
If you don't want to target the avatars, then make your selector more specific. Try this instead:
article.post .post_thumbnail img {
width: 100%;
height: auto;
margin-bottom: 20px;
}
Now, only images that are descendants of article.post and .post_thumbnail will get the styles.
revised fiddle
Related
I have a table called admin tickets. I have this situation were one of these mails, which are on the left of the screen is clicked. Then I want to fetch subject/text, to this mail.
For example I'm clicking qweqweqwe#wp.pl, and it gives me 123123123123123.
The table looks like this:
For now the page looks like this, because I'm iterating over the whole table to the end. This looks good. The only change I want to make is as I said, I want to click the mail on the left, and get subject/text of this mail.
How can I achieve it?
Html+php:
<?php
require_once '../../services/LoggedInUserService.php';
require_once '../../services/LoggedInAdminService.php';
require_once '../../db/connect.php';
$connect = new mysqli($host, $db_user, $db_password, $db_name);
?>
<!DOCTYPE html>
<html lang="pl">
<head>
<meta charset="UTF-8">
<title>DingDog</title>
<link rel="stylesheet" href="../../css-images/style-admintickets.css">
</head>
<body>
<header>
<div class="row">
<ul id="logo"><img src="../../css-images/dingdog-logo.png"></ul>
<ul class="main-nav">
<li style="padding-left:10px">TICKETS</li>
<li style="padding-left:10px" id="sign">LOG OUT</li>
</ul>
</div>
<section>
<article>
<p id="profilesign">Tickets:</p>
<?php
$result = $connect->query("SELECT emailLogin,subject,text FROM tickets");
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
$emailLogin = $row['emailLogin'];
$subject = $row['subject']; ?>
<label> <input readonly id="fi" style="margin-top: 50px;" type="text" placeholder="Example"
name="custom" value="<?php echo $emailLogin; ?>"></label><br>
<div class="container" style='position:absolute;left:0px; top:0px;'>
<h1 id="avatar">Title:</h1>
<div class="title" style='position:absolute;left:0px; top:0px;'>
<h1 id="tytul" style='position:absolute;left:0px; top:0px;'><?php echo $subject; ?></h1>
</div>
<h1 id="subject">Subject:</h1>
<textarea readonly id="subjectContainer"
style='margin-top: 100px;margin-left: 150px;position:absolute;left:0; top:0;font-size:30px; color:red ;height: 264px;
width: 683px;' rows="5" cols="10"><?php echo $row['text']; ?></textarea>
</div>
<?php }
} ?>
</article>
</section>
</header>
<footer>
<img src="../../social/instagram.png"/>
<img src="../../social/twitter-white-logo.png"/>
<img src="../../social/facebook.png"/>
</footer>
</body>
</html>
Css:
*
{
margin: 0;
padding: 0;
}
header
{
width: 1920;
height: 1080px;
}
body {
display: flex;
flex-direction: column;
min-height: 100vh;
margin:0;
height: 1080px;
width: auto;
background-image: linear-gradient(180deg, #EFEFEF00 0%, #0F4A37 100%);
}
footer{
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background-color: black;
color: white;
text-align: center;
}
footer img{
margin-top: 5px;
height: 30px;
display: inline-block;
padding: 0px 10px 0px 0px;
}
.main-nav
{
float: right;
color: #000000;
margin-top: 40px;
margin-right: 0px;
}
.main-nav li
{
display: inline-block;
}
.main-nav li a
{
color: #000000;
text-decoration: none;
font: Bold 25px/15px Arial;
padding: 5px;
}
#logo
{
margin-top: 10px;
float: left;
}
#sign a
{
background-color: #DCDFDE;
padding: 30px 15px 17px 15px;
border-top: 3px solid black;
border-bottom: 3px solid black;
border-left: 3px solid black;
border-right: 3px solid black;
}
#profilesign
{
margin-top: 200px;
margin-left: 80px;
font: Bold 57px/46px Georgia;
font-weight: bold;
color: black;
}
article input
{
-webkit-border-radius: 20px;
-khtml-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 120;
border-style: none;
padding: 5px;
width: 240px;
height: 39px;
background-color: black;
}
#fi
{
font: Bold 25px/12px Arial;
letter-spacing: 0;
color: white;
background-color: black;
margin-left: 161px;
}
.container {
margin-top: 300px;
height: 447px;
width: 1028px;
background: transparent linear-gradient(180deg, #B4FFC5 0%, #9BCEA2 31%, #523A3A 100%) 0% 0% no-repeat padding-box;
border-radius: 20px;
margin-left: 480px;
}
.title {
margin-top: 35px;
width: 686px;
height: 37px;
background: #FFFFFF 0% 0% no-repeat padding-box;
border: 1px solid #707070;
margin-left: 145px;
}
#avatar
{
font: Bold 25px/12px Arial;
letter-spacing: 0;
color: #A37373;
margin-top:50px;
margin-left: 50px;
}
#tytul
{
font: Bold 20px/24px Arial;
letter-spacing: 0;
color: #000000;
margin-top: 8px;
margin-left: 25px;
}
#subject
{
font: Bold 25px/12px Arial;
letter-spacing: 0;
color: #A37373;
margin-top:50px;
margin-left: 50px;
}
.subjectContainer
{
margin-top: 100px;
height: 264px;
width: 683px;
background: transparent linear-gradient(180deg, #B4FFC5 0%, #9BCEA2 31%, #523A3A 100%) 0% 0% no-repeat padding-box;
border: 1px solid #707070;
margin-left: 170px;
border-radius: 20px;
margin-top: 300px;
}
#subjectTitle
{
text-align: left;
font: Regular 20px/24px Arial;
letter-spacing: 0;
color: #000000;
padding-left: 5px;
}
#textare{
height: 600px;
width: 683px;
}
#media only screen and (max-device-width: 500px){
body {
background-image: linear-gradient(180deg, #EFEFEF00 0%, #0F4A37 70%);
background-size:100% 3000px;
width: auto;
}
.main-nav
{
float: right;
color: #000000;
margin-top: 40px;
margin-right: 20px;
}
.main-nav li a
{
color: #000000;
text-decoration: none;
font: Bold 31px/15px Arial;
padding: 5px;
}
#logo img
{
margin-left: 350px;
text-align: center;
width: 500px;
}
#profilesign
{
margin-top: 350px;
font-size: 90px;
margin-left: 360px;
width: 900px;
}
#tytul
{
font: Bold 40px/24px Arial;
letter-spacing: 0;
color: #000000;
margin-top: 20px;
margin-left: 25px;
}
#subjectText
{
font-size: 40px;
}
#fi
{
width: 500px;
margin-top: 500px;
font: Bold 45px/12px Arial;
letter-spacing: 0;
color: white;
background-color: black;
margin-left: 401px;
}
.container {
margin-top: 1000px;
height: 847px;
width: 1228px;
background: transparent linear-gradient(180deg, #B4FFC5 0%, #9BCEA2 31%, #523A3A 100%) 0% 0% no-repeat padding-box;
border-radius: 20px;
margin-left: 20px;
}
.subjectContainer
{
margin-top: 150px;
height: 564px;
width: 883px;
background: transparent linear-gradient(180deg, #B4FFC5 0%, #9BCEA2 31%, #523A3A 100%) 0% 0% no-repeat padding-box;
border: 1px solid #707070;
margin-left: 185px;
border-radius: 20px;
}
#avatar
{
font: Bold 55px/12px Arial;
letter-spacing: 0;
color: #A37373;
margin-top:80px;
margin-left: 40px;
}
#subject
{
font: Bold 45px/12px Arial;
letter-spacing: 0;
color: #A37373;
margin-top:80px;
margin-left: 5px;
}
.title {
margin-top: 55px;
width: 686px;
height: 67px;
background: #FFFFFF 0% 0% no-repeat padding-box;
border: 1px solid #707070;
margin-left: 185px;
}
}
Hope This will help you
<section>
<article>
<p id="profilesign">Tickets:</p>
<?php
$result = $connect->query("SELECT emailLogin,subject,text FROM tickets");
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
$emailLogin = $row['emailLogin'];
echo '<form>
<label> <input id="fi" style="margin-top: 50px;" type="submit" placeholder="Example"
name="custom" value="'.$emailLogin.'"></label><br>
</form>';
}
}?>
<?php
if(isset($_GET['custom']))
{
$text = $_GET['custom'];
$result2 = $connect->query("SELECT emailLogin,subject,text FROM tickets WHERE emailLogin = '".$text."' ");
if ($result2->num_rows > 0) {
while ($row = $result2->fetch_assoc()) {
echo ' <div class="container" style="position:absolute;left:0px; top:0px;">
<h1 id="avatar">Title:</h1>
<div class="title" style="position:absolute;left:0px; top:0px;">
<h1 id="tytul" style="position:absolute;left:0px; top:0px;">'.$subject.'</h1>
</div>
<h1 id="subject">Subject:</h1>
<textarea readonly id="subjectContainer"
style="margin-top: 100px;margin-left: 150px;position:absolute;left:0; top:0;font-size:30px; color:red ;height: 264px;
width: 683px;" rows="5" cols="10">'.$row['text'].'</textarea>
</div>';
}
}
}
?>
</article>
</section>
I would probably use Ajax for this, and then get the information that way. So when you click one of the mails on the left, then you make a Ajax call to another .php, like this.
Lets say the mail is this image.
echo'<img class="MAILyouWantToAttach" data-id = "'.$MAILyouWantToAttach.'" src = "../text.png">';
The Ajax success respons has to change the textareas content by its value.
$(document).on("click", ".Unflagging", function(){
var text= $(this).data("id");
$.ajax({
method: "post",
url: "AnotherFile.php",
data: { text: text},
success: function(data) {
$("#myTextarea").val(data);
},
error: function(data) {
alert("Error occurs!")
}
});
});
Then the other php file you want something like this, the echo is to print the text in the success area of the Ajax in the other .php.
$receiver = $_POST["text"];
$result = $connect->query("SELECT emailLogin,subject,text FROM tickets WHERE emailLogin= $receiver ");
while ($row = $result->fetch_assoc()) {
echo $row['text'];
}
This is just a guide, but i hope it helps you on your way to success.
Hello i am making my own wordpress bootstrap theme. And i have one thing what i want to make that it work nice on mobile and tablets. Right now in mobile mode my site Title in mixed together with my info box. I think it would be nice if i could move my text box under the text box when the page is visited on smaller screens.
You can see my problem in image:
My HTML:
<div class="container">
<div class="wrapper">
<h1>
<?php
if(get_theme_mod( 'header_banner_title_setting' )){
echo get_theme_mod( 'header_banner_title_setting' );
}else{
echo 'Wordpress + Bootstrap';
}
?>
</h1>
<p>
<?php
if(get_theme_mod( 'header_banner_tagline_setting' )){
echo get_theme_mod( 'header_banner_tagline_setting' );
}else{
echo esc_html__('To customize the contents of this
header banner and other elements of your site, go to D
ashboard > Appearance >
Customize','wp-bootstrap-starter');
}
?>
</p>
<div id="headertxt">
<a>Zvani - <span class="head"> (+371) 29429748</span><br />
</a>
<a href="mailto:godeli#tvnet.lv">Raksti - <span
class="head_2">godeli#tvnet.lv</span><br /></a>
<a href="/ka-mus-atrast/">Redzi mūs <span
class="head_2">kartē</span><br /></a>
<a><span class="head">57°11'58.4"N 22°12'11.2"E</span><br />
</a>
<hr>
<a href="./rekviziti/"><span
class="head_2">REKVIZĪTI</span></a>
</div>
</div>
<a href="#content" class="page-scroller"><i class="fa fa-fw fa-
angle-down"></i></a>
</div>
</div>
CSS :
header#masthead {
margin-bottom: 0;
background-color: #563d7c ;
box-shadow: 0 0.5rem 1rem rgba(0,0,0,.05), inset 0 -1px 0 rgba(0,0,0,.1);
padding: .60rem 1rem;
border-bottom: 1px solid #9175bb ;
position: fixed;
z-index: 2000;
width: 100%;
}
.navbar-brand > a {
color: rgba(0, 0, 0, 0.9);
font-size: 1.1rem;
outline: medium none;
text-decoration: none;
color: #fff;
font-weight: 700;
}
.navbar-brand > a:visited, .navbar-brand > a:hover {
text-decoration: none;
}
#page-sub-header {
position: relative;
padding-top: 15rem;
padding-bottom: 0;
text-align: center;
font-size: 1.25rem;
background-size: cover !important;
}
#page-sub-header h1 {
line-height: 1;
text-align: left;
font-size: 4rem;
color: #563e7c;
margin: 0 0 1rem;
border: 0;
padding: 0;
}
#page-sub-header p {
margin-bottom: 0;
text-align: left;
line-height: 1.4;
font-size: 1.25rem;
font-weight: 300;
color: #563e7c;
}
a.page-scroller {
color: #333;
font-size: 2.6rem;
display: inline-block;
margin-top: 2rem;
}
#media screen and (min-width: 768px) {
#page-sub-header h1 {
font-size: 3.750rem;
line-height: 1;
}
#page-sub-header {
font-size: 1.25rem;
}
}
#media screen and (min-width: 992px) {
#page-sub-header p {
max-width: 43rem;
margin: 0 auto;
}
}
#headertxt {
position: absolute;
right: 20px;
bottom: 100px;
background-size: auto;
background: rgba(0, 0, 0, 0.7);
padding: 10px 10px 10px 10px;
}
#headertxt a {
text-align: right;
color: white;
font-size: 20px;
}
I hope someone will lead me to some way how to fix this problem and points me to some good tip. Thanks!
I am making a wordpress theme with integrated woocommerce and have problem like two buttons (details & checkout) cannot show with properly in mini cart layout after added a product or more to cart on shop page like screenshot below:
After I navigated to home page it will show without any problem for mini cart below:
Header.php
<?php
/**
* The header for our theme.
*
* This is the template that displays all of the <head> section and everything up until <div id="content">
*
* #link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* #package testing
*/
global $woocommerce;
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta http-equiv="X-UA-Compatible" content="IE=10" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<div id="container">
<div id="page" class="hfeed site">
<a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip to content', 'gg' ); ?></a>
<header id="masthead" class="site-header" role="banner">
<nav id="site-navigation" class="main-navigation2" role="navigation">
<button class="menu-toggle" aria-controls="top-menu" aria-expanded="false"><?php esc_html_e( 'Top Menu', 'gg' ); ?></button>
<ul class="mini-cart">
<li> <a href="<?php echo esc_url( $woocommerce->cart->get_cart_url() ); ?>" title="<?php esc_attr_e('View your shopping cart'); ?>" class="cart-parent">
<div class="bubblex">
<div class="inside">
<div class="inside-text">
<?php
echo sprintf(_n('%d', '%d', $woocommerce->cart->cart_contents_count), $woocommerce->cart->cart_contents_count);
?></div>
</div>
</div>
<i class="cart_control">::before</i></a>
<?php
echo '<ul class="cart_list">';
echo '<li class="cart-title"><b>Isi Keranjang:</b></li>';
if (sizeof($woocommerce->cart->cart_contents)>0) : foreach ($woocommerce->cart->cart_contents as $cart_item_key => $cart_item) :
$_product = $cart_item['data'];
if ($_product->exists() && $cart_item['quantity']>0) :
echo '<li class="cart_list_product"><a href="' . esc_url( get_permalink( intval( $cart_item['product_id'] ) ) ) . '">';
/* echo $_product->get_image(); */
echo apply_filters( 'woocommerce_cart_widget_product_title', $_product->get_title(), $_product ) . '</a>';
if($_product instanceof woocommerce_product_variation && is_array($cart_item['variation'])) :
echo woocommerce_get_formatted_variation( $cart_item['variation'] );
endif;
echo '<span class="quantity">' . $cart_item['quantity'] . ' × ' . woocommerce_price( $_product->get_price() ) . '</span></li>';
endif;
endforeach;
else: echo '<li class="empty">' . __( 'Keranjang kosong') . '</li>'; endif;
if ( sizeof( $woocommerce->cart->cart_contents ) > 0 ) :
echo '<li class="total">';
echo '<span class="amount2">Total</span>' . $woocommerce->cart->get_cart_total() . '</li>';
echo '<p class="buttons">Detail Checkout</p>';
endif;
echo '</ul>';
?>
</li> </ul>
<?php wp_nav_menu( array( 'theme_location' => 'top', 'menu_id' => 'top-menu' ) ); ?>
</nav><!-- #site-navigation -->
<div class="site-branding">
<?php if ( is_front_page() && is_home() ) : ?>
<h1 class="site-title"><?php bloginfo( 'name' ); ?></h1>
<?php else : ?>
<p class="site-title"><?php bloginfo( 'name' ); ?></p>
<?php endif; ?>
<p class="site-description"><?php bloginfo( 'description' ); ?></p>
</div><!-- .site-branding -->
<nav id="site-navigation" class="main-navigation" role="navigation">
<button class="menu-toggle" aria-controls="primary-menu" aria-expanded="false"><?php esc_html_e( 'Primary Menu', 'gg' ); ?></button>
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_id' => 'primary-menu' ) ); ?>
</nav><!-- #site-navigation -->
</div><!-- #site-wrapper -->
</header><!-- #masthead -->
<div id="content" class="site-content">
Style.css
.main-navigation2 .cart_control {
display: block;
margin: 10px 0 10px 0;
padding: 0 20px 0 19px;
width: 30px;
float: right;
background: url('img/icons/set_icons/cart-grey.png') center no-repeat;
height: 30px;
/* line-height: 9999em; */
overflow: hidden;
}
.main-navigation2 .cart_wrapper {
text-align: left;
position: absolute;
width: 300px;
right: -2px;
background-color: #494949;
z-index: 1000;
padding: 20px 12px;
color: #fff;
}
.main-navigation2 .mini-cart .sf-sub-indicator {
display: none!important;
}
.main-navigation2 .mini-cart > li {
padding: 0 20px 0 20px;
display: block;
text-decoration: none;
line-height: 50px;
color: #000;
font-family: sans-serif;
background: url(img/arrow.png) no-repeat scroll right / 19% 29%;
}
.main-navigation2 .mini-cart > li ul.cart_list {
display: none!important;
visibility: hidden!important;
}
.main-navigation2 .mini-cart > li:hover {
padding: 0 20px 0 20px;
display: block;
text-decoration: none;
/* line-height: 42px; */
color: #000;
font-family: sans-serif;
}
.main-navigation2 .mini-cart a.cart-parent {
display: block;
margin: 2px 2px 0 0;
padding: 0;
width: 47px;
float: right;
background: url('img/icons/set_icons/cart-grey.png') center no-repeat;
height: 30px;
/* line-height: 0em; */
/* overflow: hidden; */
z-index: 1000;
}
.main-navigation2 .mini-cart a.cart-parent:hover {
text-decoration: none;
}
.main-navigation2 .mini-cart a.cart-parent span {
font-weight: bold;
font-family: "Bitter", sans-serif;
text-transform: uppercase;
font-size: 1.2em;
line-height: 1;
}
.main-navigation2 .mini-cart a.cart-parent mark {
display: block;
font-size: 0.6em;
font-style: normal;
font-weight: bold;
position: relative;
}
.main-navigation2 ul.mini-cart {
float: right;
margin: 6px 61px 0 0;
width: 60px;
overflow: hidden;
}
.main-navigation2 ul.mini-cart li:hover {
position: static;
}
.main-navigation2 ul.mini-cart li:hover ul.cart_list {
right: 244px;
}
.main-navigation2 ul.mini-cart li {
text-align: right;
width: auto;/* The cart contents drop down */
}
.main-navigation2 ul.mini-cart li a {
border-right: 0;
border-bottom: 0;
}
.main-navigation2 ul.mini-cart li:last-child {
border-bottom: 0;
width: auto;
}
.main-navigation2 ul.mini-cart li:hover ul.cart_list {
display: block!important;
visibility: visible!important;
}
.main-navigation2 ul.mini-cart li ul.cart_list {
text-align: left;
position: absolute;
width: 283px;
right: -2px;
background-color: #ff0000;
z-index: 1000;
padding: 16px 6px;
color: #000;/* The totals *//* The buttons */
margin: -13px 7px 0px 0px;
}
.main-navigation2 ul.mini-cart li ul.cart_list li.empty {
text-align: center;
padding: 10px;
}
.main-navigation2 ul.mini-cart li ul.cart_list li {
margin: 0px 18px 0px 18px;
padding: 0 0 6px 9px;
float: none;
/* height: 80px; */
border: 0;
line-height: 1.1;
background: #fff;
/* -webkit-border-radius: 10px; */
-moz-border-radius: 10px;
}
.main-navigation2 ul.mini-cart li ul.cart_list li.cart-title {
border: 0;
text-align: left;
font-family: arial;
font-size: 1.5em;
color: #000;
background-color: #ff0000;
}
.main-navigation2 ul.mini-cart li ul.cart_list li.cart-title h3 {
padding: 6px 0 6px;
margin: 0;
font-weight: bold;
color: #fff;
font-size: 1.2em;
text-shadow: 1px 1px 0 #050505;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.main-navigation2 ul.mini-cart li ul.cart_list li.cart_list_product {
text-align: left;
overflow: hidden;
zoom: 1;
clear: left;
}
.main-navigation2 ul.mini-cart li ul.cart_list li.cart_list_product:first-child {
border-top: 0;
}
.main-navigation2 ul.mini-cart li ul.cart_list li.cart_list_product img {
float: right;
padding: .27em;
background: #fff;
-webkit-border-radius: 0.136em;
-moz-border-radius: 0.136em;
border-radius: 0.136em;
margin: 0 0 .27em .27em;
}
.main-navigation2 ul.mini-cart li ul.cart_list li.cart_list_product a {
border: 0;
margin: -5px 0 0 0;
padding: 0;
/* text-shadow: 1px 1px 0 #050505; */
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
color: #000;
font-size: 1em;
text-decoration: none!important;
background: none;
font-weight: bold;
text-transform: uppercase;
white-space: normal;
width: auto;
}
.main-navigation2 ul.mini-cart li ul.cart_list li.cart_list_product a:hover {
border: 0;
padding: 0;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
background: none;
}
.main-navigation2 ul.mini-cart li ul.cart_list li.cart_list_product dl.variation {
overflow: hidden;
zoom: 1;
margin-bottom: 0;
filter: alpha(opacity=#opacity * 100);
-moz-opacity: 0.7;
-khtml-opacity: 0.7;
opacity: 0.7;
}
.main-navigation2 ul.mini-cart li ul.cart_list li.cart_list_product dl.variation dt {
float: left;
clear: left;
font-weight: 700;
}
.main-navigation2 ul.mini-cart li ul.cart_list li.total {
text-align: left;
color: #000;
padding: 6px 10px 6px;
margin: 20px 16px 6px;
background: #fff;
font-size: 1.2em;
line-height: 1;
/* text-transform: uppercase; */
border-bottom: none;
/* -webkit-border-radius: 10px; */
-moz-border-radius: 10px;
border-radius: 10px;
/* box-shadow: 0 0 1px 0 rgba(255, 255, 255, 0.3); */
/* -webkit-box-shadow: 0 0 1px 0 rgba(255, 255, 255, 0.3); */
-moz-box-shadow: 0 0 1px 0 rgba(255, 255, 255, 0.3);
-o-box-shadow: 0 0 1px 0 rgba(255, 255, 255, 0.3);
}
.main-navigation2 ul.mini-cart li ul.cart_list p.buttons {
text-align: center;
height: 20px!important;
padding: 4px 0 0 0!important;
}
.main-navigation2 ul.mini-cart li ul.cart_list p.buttons .button {
border-top: 1px solid #451c08;
background: #573220;
background:
-webkit-gradient(linear, left top, left bottom, from(#de591b), to(#573220));
background:
-webkit-linear-gradient(top, #de591b, #573220);
background:
-moz-linear-gradient(top, #de591b, #573220);
background:
-ms-linear-gradient(top, #de591b, #573220);
background:
-o-linear-gradient(top, #de591b, #573220);
padding: 0px 12px;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: -2px;
-webkit-box-shadow: rgba(0,0,0,1) 0 1px 0;
-moz-box-shadow: rgba(0,0,0,1) 0 1px 0;
box-shadow: rgba(0,0,0,1) 0 1px 0;
text-shadow: rgba(0,0,0,.4) 0 1px 0;
color: white;
font-size: 12px;
font-family: Helvetica, Arial, Sans-Serif;
text-decoration: none;
vertical-align: middle;
width: 100px;
height: 36px;
margin: 0 0 -37px 16px;
}
.main-navigation2 ul.mini-cart li ul.cart_list p.buttons .button.checkout {
margin: 0 0 0 160px;
}
.main-navigation2 ul.mini-cart li ul.cart_list p.buttons .button:hover {
border-top-color: #853718;
background: #853718;
color: #ccc;
}
.main-navigation2 ul.mini-cart li ul.cart_list p.buttons .button:active {
border-top-color: #573220;
background: #573220;
}
span.amount2 {
text-align: left;
margin: 0 30px 0 8px;
color: #000;
}
So how I can fix it to make mini cart layout will show with properly for all pages on my custom theme?
try this css
.main-navigation2 ul.mini-cart li ul.cart_list p.buttons{ position:
relative } .main-navigation2 ul.mini-cart li ul.cart_list p.buttons
.button{ position: absolute: -4px; }
I'm trying to add new fields in moodle login page. I'm simply editing the index_form.html in login folder.
I'm using evolve theme and using moodle version 2.8
I want a dropdown field for administrator, teacher and student. If user selects administrator or teacher they have the fields of username and password, but if student is been selected one extra field of Adhar number is added for validation dynamically.
I have created the fields just need to add it to database and conditional logic. In the backend of user profile fields I've added a custom user fields under the name of Adhar Number whose short name I've kept as Adharno, lot of things more is to be done and I'm unable to find path, following is the link below with html code and css
www.sanskritiskills.com/assessment/login/index.php
Code block:
<?php
if ($show_instructions) {
$columns = 'twocolumns';
} else {
$columns = 'onecolumn';
}
if (!empty($CFG->loginpasswordautocomplete)) {
$autocomplete = 'autocomplete="off"';
} else {
$autocomplete = '';
}
if (empty($CFG->authloginviaemail)) {
$strusername = get_string('username');
} else {
$strusername = get_string('usernameemail');
}
?>
<div class="loginbox clearfix <?php echo $columns ?>">
<div class="loginpanel">
<?php
if (($CFG->registerauth == 'email') || !empty($CFG->registerauth)) { ?>
<div class="skiplinks"><a class="skip" href="signup.php"><?php print_string("tocreatenewaccount"); ?></a></div>
<?php
} ?>
<h2><?php print_string("login") ?></h2>
<div class="subcontent loginsub">
<?php
if (!empty($errormsg)) {
echo html_writer::start_tag('div', array('class' => 'loginerrors'));
echo html_writer::link('#', $errormsg, array('id' => 'loginerrormessage', 'class' => 'accesshide'));
echo $OUTPUT->error_text($errormsg);
echo html_writer::end_tag('div');
}
?>
<form action="<?php echo $CFG->httpswwwroot; ?>/login/index.php" method="post" id="login" <?php echo $autocomplete; ?> >
<div class="loginform">
<div class="form-input">
Select Role :
<select required>
<option value="Admin">Admin</option>
<option value="Student">Student</option>
<option value="Teacher">Teacher</option>
</select>
</div>
</div>
<div class="clearer"><!-- --></div>
<div class="form-label"><label for="username"><?php echo($strusername) ?></label></div>
<div class="form-input">
<input type="text" name="username" id="username" size="15" value="<?php p($frm->username) ?>" />
</div>
<div class="clearer"><!-- --></div>
<div class="form-label"><label for="password"><?php print_string("password") ?></label></div>
<div class="form-input">
<input type="password" name="password" id="password" size="15" value="" <?php echo $autocomplete; ?> />
</div>
<div class="clearer"><!-- --></div>
<div class="form-label"><label for="password">Adhar No.</label></div>
<div class="form-input">
<input type="password" name="Adhar Number" id="password" size="15" value="" <?php echo $autocomplete; ?> />
</div>
</div>
<div class="clearer"><!-- --></div>
<?php if (isset($CFG->rememberusername) and $CFG->rememberusername == 2) { ?>
<div class="rememberpass">
<input type="checkbox" name="rememberusername" id="rememberusername" value="1" <?php if ($frm->username) {echo 'checked="checked"';} ?> />
<label for="rememberusername"><?php print_string('rememberusername', 'admin') ?></label>
</div>
<?php } ?>
<div class="clearer"><!-- --></div>
<input type="submit" id="loginbtn" value="<?php print_string("login") ?>" />
<div class="forgetpass"><?php print_string("forgotten") ?></div>
</form>
<div class="desc">
<?php
echo get_string("cookiesenabled");
echo $OUTPUT->help_icon('cookiesenabled');
?>
</div>
</div>
<?php if ($CFG->guestloginbutton and !isguestuser()) { ?>
<div class="subcontent guestsub">
<div class="desc">
<?php print_string("someallowguest") ?>
</div>
<form action="index.php" method="post" id="guestlogin">
<div class="guestform">
<input type="hidden" name="username" value="guest" />
<input type="hidden" name="password" value="guest" />
<input type="submit" value="<?php print_string("loginguest") ?>" />
</div>
</form>
</div>
<?php } ?>
</div>
<?php if ($show_instructions) { ?>
<div class="signuppanel">
<h2><?php print_string("firsttime") ?></h2>
<div class="subcontent">
<?php if (is_enabled_auth('none')) { // instructions override the rest for security reasons
print_string("loginstepsnone");
} else if ($CFG->registerauth == 'email') {
if (!empty($CFG->auth_instructions)) {
echo format_text($CFG->auth_instructions);
} else {
print_string("loginsteps", "", "signup.php");
} ?>
<div class="signupform">
<form action="signup.php" method="get" id="signup">
<div><input type="submit" value="<?php print_string("startsignup") ?>" /></div>
</form>
</div>
<?php } else if (!empty($CFG->registerauth)) {
echo format_text($CFG->auth_instructions); ?>
<div class="signupform">
<form action="signup.php" method="get" id="signup">
<div><input type="submit" value="<?php print_string("startsignup") ?>" /></div>
</form>
</div>
<?php } else {
echo format_text($CFG->auth_instructions);
} ?>
</div>
</div>
<?php } ?>
<?php if (!empty($potentialidps)) { ?>
<div class="subcontent potentialidps">
<h6><?php print_string('potentialidps', 'auth'); ?></h6>
<div class="potentialidplist">
<?php foreach ($potentialidps as $idp) {
echo '<div class="potentialidp">' . $OUTPUT->render($idp['icon'], $idp['name']) . $idp['name'] . '</div>';
} ?>
</div>
</div>
<?php } ?>
</div>
CSS File which is available:
/* evolved CSS
-------------------------*/
#dock {background: #32352c; }
.arrow {color: #3d3d3d; }
.block .header h2 {color: #3d3d3d;}
.dir-rtl a.logo {
background: url([[setting:logo]]) no-repeat 100% 0;
display: block;
float: right;
}
.pagelayout-report .no-overflow {
overflow: auto;
}
.service {
display:block;
padding:10px;
margin: 10px;
text-align:left;
background-color: [[setting:marketboxcolor]];
-webkit-border-radius:4px;
-moz-border-radius:4px;
border-radius:4px;
}
#fullbkg {
background: url([[setting:fpbkg]]) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
/*Frontpage Login*/
.wrap {
width:250px;
height: auto;
margin: auto;
margin-top: 10%;
margin-bottom: 3%;
}
.avatarlogin {
width: 100%;
margin: auto;
width: 65px;
border-radius: 100px;
height: 65px;
background: #000 ;
position: relative;
bottom: -15px;
}
.avatarlogin img {
width: 55px;
height: 55px;
border-radius: 100px;
margin: auto;
border:3px solid #fff;
display: block;
}
.wrap input {
border: none;
background: #fff;
font-family:Lato ;
font-weight:700 ;
display: block;
height: 40px;
outline: none;
width: calc(100% - 24px) ;
margin: auto;
padding: 6px 12px 6px 12px;
}
.bar {
width: 100%;
height: 1px;
background: #fff ;
}
.bar i {
width: 95%;
margin: auto;
height: 1px ;
display: block;
background: #d1d1d1;
}
.wrap input[type="text"] {
border-radius: 7px 7px 0px 0px ;
}
.wrap input[type="password"] {
border-radius: 0px 0px 7px 7px ;
}
.forgot_link {
color: #83afdf ;
color: #83afdf;
text-decoration: none;
font-size: 11px;
position: relative;
left: 193px;
top: -36px;
}
.wrap button {
width: 100%;
border-radius: 7px;
background: #b6ee65;
text-decoration: center;
border: none;
color: #51771a;
margin-top:-5px;
padding-top: 14px;
padding-bottom: 14px;
outline: none;
font-size: 20px;
border-bottom: 3px solid #307d63;
cursor: pointer;
}
/*.loginbox {
background: rgba(100,100,100,.1);
padding:50px;
-webkit-box-shadow: 1px 0px 29px 14px rgba(255,255,255,0.6);
-moz-box-shadow: 1px 0px 29px 14px rgba(255,255,255,0.6);
box-shadow: 1px 0px 29px 14px rgba(255,255,255,0.6);
-webkit-border-radius:10px;
-moz-border-radius:10px;
border-radius:10px;
}*/
.loginbox h2{
color: #DBDBDB;
text-align:center;
}
.loginbox form a{
color: #fff;
}
.loginbox form{
color: #fff;
}
.loginbox p{
color: #fff;
}
/*.loginpanel .loginsub {
background: rgba(0,0,0,.6);
-webkit-border-radius:10px;
-moz-border-radius:10px;
border-radius:10px;
margin: 10px;
}*/
.loginpanel .loginsub {
background: rgba(0,0,0,.8);
max-width:400px;
-webkit-box-shadow: 1px 0px 29px 14px rgba(255,255,255,0.6);
-moz-box-shadow: 1px 0px 29px 14px rgba(255,255,255,0.6);
box-shadow: 1px 0px 29px 14px rgba(255,255,255,0.6);
-webkit-border-radius:10px;
-moz-border-radius:10px;
border-radius:10px;
border:5px solid #fff;
margin: auto;
padding:20px;
}
.signuppanel .subcontent{
background: rgba(0,0,0,.6);
max-width:400px;
-webkit-box-shadow: 1px 0px 29px 14px rgba(255,255,255,0.6);
-moz-box-shadow: 1px 0px 29px 14px rgba(255,255,255,0.6);
box-shadow: 1px 0px 29px 14px rgba(255,255,255,0.6);
-webkit-border-radius:10px;
-moz-border-radius:10px;
border-radius:10px;
margin: auto;
}
/* Alerts (aardvark) */
#page-header-generalalert {
clear:both;
display: block;
color:#ff9f00;
background-color:#fef8d2;
padding:8px 35px 8px 14px;
margin-bottom:20px;
text-shadow:0 1px 0 rgba(255,255,255,0.5);
border:1px solid #fde6af;
-webkit-border-radius:4px;
-moz-border-radius:4px;
border-radius:4px;
}
#page-header-generalalert:before {
background-color: #ff9f00;
color: #FFFFFF;
display: block;
float: left;
font-family: FontAwesome;
font-size: 1.2em;
height: 1.4em;
margin-right: 0.5em;
margin-top: -0.15em;
margin-left: -0.5em;
padding-top: 0.2em;
text-align: center;
width: 1.7em;
content:"\f06a";
border-radius: 3px 3px 3px 3px;
text-shadow:none;
}
#page-header-snowalert {
clear:both;
display: block;
color:#3a87ad;
background-color:#d9edf7;
padding:8px 35px 8px 14px;
margin-bottom:20px;
text-shadow:0 1px 0 rgba(255,255,255,0.5);
border:1px solid #bce8f1;
-webkit-border-radius:4px;
-moz-border-radius:4px;
border-radius:4px;
}
#page-header-snowalert:before {
background-color: #3a87ad;
color: #FFFFFF;
display: block;
float: left;
font-family: FontAwesome;
font-size: 1.2em;
height: 1.4em;
margin-right: 0.5em;
margin-top: -0.15em;
margin-left: -0.5em;
padding-top: 0.2em;
text-align: center;
width: 1.7em;
content:"\f069";
border-radius: 3px 3px 3px 3px;
text-shadow:none;
}
/*Google Fonts (Theme Essential)*/
/* #group Headings */
h1, h2, h3, h4, h5, h6,
.back-to-top,
.socials p,
#socialheading,
.forumpost .subject,
.block_login label {
font-family: "[[setting:headingfont]]", sans-serif;
}
/* #group Main Text */
body,
.block_login input[type="submit"] {
font-family: "[[setting:bodyfont]]", Arial, Helvetica, sans-serif;
font-size: [[setting:bodysize]];
font-weight: [[setting:bodyweight]];
}
/* #end */
/*Special thanks to Shaun Daubney (Theme Aardvark)
for the colored icons in the blocks.
*/
.block .header .title h2:before {
color: #FFFFFF;
display: block;
float: left;
font-family: FontAwesome;
font-size: 1.2em;
height: 1.3em;
margin-left: -0.5em;
margin-right: 0.5em;
margin-top: -0.2em;
padding-top: 0.2em;
text-align: center;
width: 1.5em;
-webkit-border-radius:2px;
-moz-border-radius:2px;
border-radius:2px;
}
.block_news_items .header .title h2:before {
background-color: #29A294;
content:"\f0a1";
}
.block_navigation .header .title h2:before {
background-color: #f42941;
content:"\f0e8";
}
.block_calendar_upcoming .header .title h2:before,
.block_calendar_month .header .title h2:before {
background-color: #008ecd;
content:"\f073";
}
.block_course_list .header .title h2:before {
background-color: #ffce00;
content:"\f108";
}
.block_completionstatus .header .title h2:before,
.block_selfcompletion .header .title h2:before {
background-color: #76b900;
content:"\f0e4";
}
.block_rss_client .header .title h2:before {
background-color: #ff9500;
content:"\f09e";
}
.block_rss_plus .header .title h2:before {
background-color: #ff9500;
content:"\f09e";
}
.block_blog_menu .header .title h2:before {
background-color: #ff9500;
content:"\f02d";
}
.block_quiz_results .header .title h2:before {
background-color: #76b900;
content:"\f080";
}
.block_quiz_navblock .header .title h2:before {
background-color: #76b900;
content:"\f126";
}
.block_glossary_random .header .title h2:before {
background-color: #3d3d3d;
content:"\f0eb";
}
.block_book_toc .header .title h2:before {
background-color: #3d3d3d;
content:"\f02d";
}
.block_participants .header .title h2:before,
.block_online_users .header .title h2:before {
background-color: #92499e;
content:"\f0c0";
}
.block_html .header .title h2:before {
background-color: #eeeeee;
}
.block_section_links .header .title h2:before {
background-color: #f42941;
content:"\f02e";
}
.block_activity_modules .header .title h2:before {
background-color: #f42941;
content:"\f12e";
}
.block_comments .header .title h2:before {
background-color: #ffce00;
content:"\f075";
}
.block_settings .header .title h2:before,
.block_admin_bookmarks .header .title h2:before{
background-color: #004675;
content:"\f085";
}
.block_blog_tags .header .title h2:before,
.block_tags .header .title h2:before {
background-color: #ff9f00;
content:"\f02c";
}
.block_private_files .header .title h2:before {
background-color: #82cadd;
content:"\f114";
}
.block_block_mentees .header .title h2:before {
background-color: #3d3d3d;
content:"\f0c0";
}
.block_messages .header .title h2:before {
background-color: #ffce00;
content:"\f0e0";
}
.block_community .header .title h2:before {
background-color: #ffce00;
content:"\f0ac";
}
.block_login .header .title h2:before {
background-color: #3d3d3d;
content:"\f007";
}
.block_recent_activity .header .title h2:before {
background-color: #cee3ed;
content:"\f017";
}
.block_search_forums .header .title h2:before {
background-color: #ffce00;
content:"\f0e6";
}
.block_myprofile .header .title h2:before {
background-color: #f42941;
content:"\f007";
}
.block_adminblock .header .title h2:before {
background-color: #E0F52A;
content:"\f055";
}
.block_feedback .header .title h2:before {
background-color: #ffce00;
content:"\f087";
}
.block_flickr .header .title h2:before {
background-color: #ff3096;
content:"\f03e";
}
.block_youtube .header .title h2:before {
background-color: #f42941;
content:"\f145";
}
.block_course_badges .header .title h2:before {
background-color: #29a294;
content:"\f091";
}
.block_twitter_search .header .title h2:before {
background-color: #008ecd;
content:"\f099";
}
.block_heritage .header .title h2:before {
background-color: #3e647e;
content:"\f02d";
}
.block_lrc .header .title h2:before {
background-color: #3e647e;
content:"\f02d";
}
/*Social Wall*/
.format-socialwall .course-content ul.topics li.section {
border-bottom: 0px solid #ccc;
margin-top: 0;
}
/*.mform {
background-color: #f2f2f2;
padding: 10px;
border-radius: 10px;
}*/
.format-socialwall #section-2 .content {
background-color: #f7f7f7;
padding: 10px;
margin: 0px;
border: 3px solid #d4d4d4;
border-radius: 4px;
margin-top:15px;
margin-bottom: 15px;
-moz-box-shadow: 0px 0px 25px #ccc;
-webkit-box-shadow: 0 0 25px #ccc;
box-shadow: 0px 0px 25px #ccc;
}
.tl-post {
margin: 30px 0px 50px 0px;
padding:15px;
}
.tl-posttext {
background-color: #fff;
padding: 10px 10px 20px 10px;
border-radius: 10px 10px 0px 0px;
//border: 1px solid #ccc;
margin-top: 10px;
}
ul.section.tl-postattachment {
background-color: #fff;
padding: 5px 5px 5px 50px;
//border-left: 1px solid #ccc;
//border-right: 1px solid #ccc;
margin:0px;
}
.tl-text {
margin-left: 40px;
padding: 0 5px;
border: 2px solid #efefef;
padding: 10px;
-moz-box-shadow: 0px 0px 25px #e7e7e7;
-webkit-box-shadow: 0 0 25px #e7e7e7;
box-shadow: 0px 0px 25px #e7e7e7;
border-radius: 4px 4px 4px 4px;
}
/*.tl-text {
margin-left: 40px;
//border: none;
border: 1px solid #efefef;
background-color: #f7f7f7;
padding:7px;
border-radius: 10px 10px 10px 10px;
}*/
.tl-comments {
background-color: #f7f7f7;
padding:15px;
margin:0px;
}
.tl-comment {
padding-left:25px;
padding-top: 0px;
padding-bottom: 0px;
}
.tl-post-actionarea {
//border: 1px solid #ccc;
padding: 4px 4px 10px 4px;
//background: #F0F3F7;
//border-radius: 0px 0px 5px 5px;
}
.tl-timeago, .tl-counts {
font-size: 12px;
color: #666;
line-height: 15px;
padding-bottom: 5px;
}
.like {
border-top: 1px solid #96d1f8;
background: #65a9d7;
background: -webkit-gradient(linear, left top, left bottom, from(#3e779d), to(#65a9d7));
background: -webkit-linear-gradient(top, #3e779d, #65a9d7);
background: -moz-linear-gradient(top, #3e779d, #65a9d7);
background: -ms-linear-gradient(top, #3e779d, #65a9d7);
background: -o-linear-gradient(top, #3e779d, #65a9d7);
padding: 5px 5px;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
-webkit-box-shadow: rgba(0,0,0,1) 0 1px 0;
-moz-box-shadow: rgba(0,0,0,1) 0 1px 0;
box-shadow: rgba(0,0,0,1) 0 1px 0;
text-shadow: rgba(0,0,0,.4) 0 1px 0;
color: white;
font-size: 14px;
font-family: Georgia, serif;
text-decoration: none;
vertical-align: middle;
}
.like:hover {
border-top-color: #28597a;
background: #28597a;
color: #ccc;
}
.like:active {
border-top-color: #1b435e;
background: #1b435e;
}
.likenomore {
border-top: 1px solid #96d1f8;
background: #65a9d7;
background: -webkit-gradient(linear, left top, left bottom, from(#3e779d), to(#65a9d7));
background: -webkit-linear-gradient(top, #3e779d, #65a9d7);
background: -moz-linear-gradient(top, #3e779d, #65a9d7);
background: -ms-linear-gradient(top, #3e779d, #65a9d7);
background: -o-linear-gradient(top, #3e779d, #65a9d7);
padding: 5px 5px;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
-webkit-box-shadow: rgba(0,0,0,1) 0 1px 0;
-moz-box-shadow: rgba(0,0,0,1) 0 1px 0;
box-shadow: rgba(0,0,0,1) 0 1px 0;
text-shadow: rgba(0,0,0,.4) 0 1px 0;
color: white;
font-size: 14px;
font-family: Georgia, serif;
text-decoration: none;
vertical-align: middle;
}
.likenomore:hover {
border-top-color: #28597a;
background: #28597a;
color: #ccc;
}
.likenomore:active {
border-top-color: #1b435e;
background: #1b435e;
}
form.tl-commentform {
padding-top: 10px;
}
#postform .fitem .felement #id_submitbutton {
margin:0px;
}
Please help me out in this
I'm not 100% sure what you're asking here - Is it the backend element or is it the frontend element that you're struggling with?
The easiest way (not the best way) to achieve what you're doing here is to hide the extra field if the user selects a non-student role. This is just basic JavaScript.
The script you're looking for looks something like this:
$(document).ready(function () {
$("select").change(function () {
$("select option:selected").each(function () {
if ($(this).attr("value") == "Student") {
$(".test").show();
}
if ($(this).attr("value") != "Student") {
$(".test").hide();
}
});
}).change();
});
And here's the Fiddle to see it in action.
HTH
I am trying to create a forum software and I would like when my breadcrumb links, change depending on what I clicked:
And:
Here is how my files are coordinated:
header.php, index.php, members.php, css/style.css
I would like that the element automatically changes according to the clicked page.
header.php code:
<div id="top_bar">
<div class="wrapper">
<div id="top_bar_links">
<ul>
<?php
$full_name = $_SERVER["PHP_SELF"];
$name_array = explode("/",$full_name);
$count = count($name_array);
$page_name = $name_array[$count-1];
?>
<li>
<a class="<?php echo ($page_name=="index.php")?"active":"";?>" href="index.php">Forums</a>
</li>
<li>
<a class="<?php echo ($page_name=="members.php")?"active":"";?>" href="members.php">Members</a>
</li>
</ul>
</div>
</div>
</div>
<div id="header">
<div class="wrapper">
<h1 id="logo">
NextGenFocus
</h1>
<div id="user_links">
<ul>
<li id="sign_up">
Sign Up
</li>
<li id="sign_in">
Sign In
</li>
</ul>
</div>
</div>
</div>
<div class="wrapper">
<div id="container">
<div id="breadcrumb_top">
<div class="breadcrumb_links">
<ul>
<li class="forums">
Forums
</li>
</ul>
</div>
</div>
</div>
</div>
index.php and members.php code:
<?php
include "header.php";
?>
style.css code:
/* CORE */
h1, h2, h3, h4, h5, h6 {
font-weight: normal;
margin: 0;
}
h1 {
font-size: 25px;
}
h2 {
font-size: 20px;
}
h3 {
font-size: 18px;
}
h4 {
font-size: 17px;
}
h5 {
font-size: 15px;
}
h6 {
font-size: 13px;
}
body {
background-color: #e6e9ed;
color: #000;
font-family: "Trebuchet MS", sans-serif;
font-size: 13px;
margin: 0;
padding-bottom: 15px;
}
.wrapper {
width: 980px;
margin: 0 auto;
}
a {
color: #4d7799;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
p {
margin: 0;
}
/* TOP BAR */
#top_bar {
background-color: #262d35;
height: 55px;
}
#top_bar_links ul {
list-style: none;
margin: 0;
padding: 0;
}
#top_bar_links a {
color: #fff;
opacity: 0.6;
float: left;
display: block;
line-height: 55px;
padding: 0 25px;
}
#top_bar_links a:hover {
background-color: #000;
opacity: inherit;
text-decoration: none;
}
#top_bar_links a.active {
background-color: #000;
opacity: inherit;
}
#top_bar_links a:hover {
background-color: #000;
opacity: inherit;
text-decoration: none;
}
/* HEADER */
#header {
background-color: #3d5e78;
height: 115px;
margin-bottom: -25px;
}
#logo {
float: left;
}
#logo a {
color: #fff;
font-size: 25px;
line-height: 90px;
}
#logo a:hover {
text-decoration: none;
}
#user_links li {
float: right;
}
#user_links ul {
list-style: none;
margin: 0;
padding: 0;
}
#user_links a {
color: #fff;
line-height: 90px;
margin-left: 15px;
}
/* CONTAINER */
#container {
background-color: #fff;
box-shadow: rgba(0,0,0,0.3) 0px 1px 7px;
padding: 15px;
}
#breadcrumb_top {
background-color: #f5f5f5;
height: 45px;
margin: -15px -15px 15px -15px;
}
#breadcrumb_bottom {
background-color: #f5f5f5;
height: 45px;
margin: 0 -15px -15px -15px;
}
.breadcrumb_links ul {
list-style: none;
margin: 0;
padding: 0;
}
.breadcrumb_links li {
float: left;
}
.breadcrumb_links a {
color: #000;
line-height: 45px;
margin-left: 15px;
}
.separator {
margin-left: 10px;
}
It seems you need to put something dynamic where you presently have 'Forums'. You have your pagename (members.php) in the variable $page_name, so try this:
<?php echo ucfirst(str_replace('.php', '', $page_name)) ?>
That will remove the ".php" from the string (so it turns into "members") and then upper-case the first letter (so it turns into "Members"). Don't be afraid to try out some other string operations if you need to adjust it further!