For some reason the <li> items are duplicating in my wordpress site. I have isolated the code in the header.php file to what you see below. I also don't think the problem is in the CSS but I cant figure out what is causing this.
The code going in looks like this:
<div id="toplinks">
<ul id="links">
<li><a class="narch"/> </li>
<li><a href="http://www.torhs.com" title="TORHS" class="torhs" target="_blank" /> </li>
<li><a href="http://www.omrha.com" title="OMRHA" class="omhra" target="_blank" /></li>
<li><a href="http://www.jangosportswear.com" title="JANGO" class="jango" target="_blank" /> </li>
<li><a href="http://www.statewarshockey.com" title="State Wars" class="statewars" target="_blank" /> </li>
<li><a href="#" title="Wicked Biscuit" class="wickedbiscuit" target="_blank" /> </li>
<li><a href="#" title="Rattlers" class="rattlers" target="_blank" /> </li>
<li><a href="http://www.revisionhockey.com" title="Revision Hockey" class="revision" target="_blank" /> </li>
<li><a href="http://www.rollerhockeyalliance.com" title="RHA" class="RHA" target="_blank" /> </li>
<li><a href="http://www.rinkrathockey.com" title="Rink Rat" class="rinkrat" target="_blank" /> </li>
<li><a href="http://www.rocketpuck.com" title="Rocket Puck" class="rocketpuck" target="_blank" /> </li>
<li><a href="http://www.missionhockey.com" title="Mission" class="mission" target="_blank" /> </li>
</ul>
</div> <!--clooses toplinks-->
The code coming out (taken using firebug) looks like this.
<ul id="links">
<li>
<a class="narch"> </a>
</li>
<a class="narch"> </a>
<li>
<a class="narch"></a>
<a class="torhs" target="_blank" title="TORHS" href="http://www.torhs.com"> </a>
</li>
<a class="torhs" target="_blank" title="TORHS" href="http://www.torhs.com"> </a>
<li>
<a class="torhs" target="_blank" title="TORHS" href="http://www.torhs.com"></a>
<a class="omhra" target="_blank" title="OMRHA" href="http://www.omrha.com"></a>
</li>
<a class="omhra" target="_blank" title="OMRHA" href="http://www.omrha.com"> </a>
<li>
<a class="omhra" target="_blank" title="OMRHA" href="http://www.omrha.com"></a>
<a class="jango" target="_blank" title="JANGO" href="http://www.jangosportswear.com"> </a>
</li>
<a class="jango" target="_blank" title="JANGO" href="http://www.jangosportswear.com"> </a>
<li>
<a class="jango" target="_blank" title="JANGO" href="http://www.jangosportswear.com"></a>
<a class="statewars" target="_blank" title="State Wars" href="http://www.statewarshockey.com"> </a>
</li>
<a class="statewars" target="_blank" title="State Wars" href="http://www.statewarshockey.com"> </a>
<li>
<a class="statewars" target="_blank" title="State Wars" href="http://www.statewarshockey.com"></a>
<a class="wickedbiscuit" target="_blank" title="Wicked Biscuit" href="#"> </a>
</li>
<a class="wickedbiscuit" target="_blank" title="Wicked Biscuit" href="#"> </a>
<li>
<a class="wickedbiscuit" target="_blank" title="Wicked Biscuit" href="#"></a>
<a class="rattlers" target="_blank" title="Rattlers" href="#"> </a>
</li>
<a class="rattlers" target="_blank" title="Rattlers" href="#"> </a>
<li>
<a class="rattlers" target="_blank" title="Rattlers" href="#"></a>
<a class="revision" target="_blank" title="Revision Hockey" href="http://www.revisionhockey.com"> </a>
</li>
<a class="revision" target="_blank" title="Revision Hockey" href="http://www.revisionhockey.com"> </a>
<li>
<a class="revision" target="_blank" title="Revision Hockey" href="http://www.revisionhockey.com"></a>
<a class="RHA" target="_blank" title="RHA" href="http://www.rollerhockeyalliance.com"> </a>
</li>
<a class="RHA" target="_blank" title="RHA" href="http://www.rollerhockeyalliance.com"> </a>
<li>
<a class="RHA" target="_blank" title="RHA" href="http://www.rollerhockeyalliance.com"></a>
<a class="rinkrat" target="_blank" title="Rink Rat" href="http://www.rinkrathockey.com"> </a>
</li>
<a class="rinkrat" target="_blank" title="Rink Rat" href="http://www.rinkrathockey.com"> </a>
<li>
<a class="rinkrat" target="_blank" title="Rink Rat" href="http://www.rinkrathockey.com"></a>
<a class="rocketpuck" target="_blank" title="Rocket Puck" href="http://www.rocketpuck.com"> </a>
</li>
<a class="rocketpuck" target="_blank" title="Rocket Puck" href="http://www.rocketpuck.com"> </a>
<li>
<a class="rocketpuck" target="_blank" title="Rocket Puck" href="http://www.rocketpuck.com"></a>
<a class="mission" target="_blank" title="Mission" href="http://www.missionhockey.com"> </a>
</li>
<a class="mission" target="_blank" title="Mission" href="http://www.missionhockey.com"> </a>
</ul>
<a class="mission" target="_blank" title="Mission" href="http://www.missionhockey.com"> </a>
</div>
<a class="mission" target="_blank" title="Mission" href="http://www.missionhockey.com"> </a>
You might be confusing HTML with XML-style markup.
The most basic link is marked up like so:
Google
The title attribute is actually what shows for the element's tooltip.
<a class="narch"/>
Close your anchors correctly
Related
hope you are all doing well, i have just face a problem. i make my website online. everything working well expect navbar toggler icon. it is not working on mobile device. it is working well on desktop
here is my code
<nav class="navbar navbar-expand-md navbar-light bg-light sticky-top">
<div class="container-fluid">
<a class="navbar-brand" href="index.php"><img src="./assests/images/logo.png" class="logo ml-5" alt="file not found" /> </a>
<button class="navbar-toggler " type="button" role="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"> </span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item <?php if($page == 'home') echo 'active' ?>">
<a class="nav-link " href="index.php"><i class="mr-2 fas fa-home"> </i>Home </a>
</li>
<li class="nav-item <?php if($page == 'about') echo 'active' ?>">
<a class="nav-link" href="about.php"><i class="mr-2 fas fa-users"> </i> About Us</a>
</li>
<li class="nav-item dropdown <?php if($page == 'products') echo 'active' ?>" >
<a class="nav-link dropdown-toggle dropdown-toggle-split" href="products.php" data-toggle="dropdown" id="dropedownMenuButton"aria-expanded="false" aria-hospopup="true" >
<i class="mr-2 fas fa-wrench"> </i>Products
</a>
<ul class="dropdown-menu" aria-labelledby="dropedownMenuButton">
<li class="list-group-item">
<a class="dropdown-item" href="bolts-screws.php"> Bolts/Screws </a>
</li>
<li class="list-group-item">
<a class="dropdown-item" href="nuts.php"> Nuts </a>
</li>
<li class="list-group-item">
<a class="dropdown-item" href="washers.php"> Washers </a>
</li>
<li class="list-group-item">
<a class="dropdown-item" href="screws.php"> Screws </a>
</li>
<li class="list-group-item">
<a class="dropdown-item" href="socket-bolt-screws.php"> Socket Bolts/Screws </a>
</li>
<li class="list-group-item">
<a class="dropdown-item" href="anchor-fastener.php"> Anchor Fasteners </a>
</li>
</ul>
</li>
<li class="nav-item <?php if($page == 'connect') echo 'active' ?>">
<a class="nav-link" href="connect.php"><i class="mr-2 fas fa-user"> </i> Contact us </a>
</li>
</ul>
</div>
</div>
</nav>
you can check my website also
http://rudrafasteners.com/
It seems you don't add Javascript at your head. Add the followings lines to your HTML <head> tag (Jquery and Bootstrap JS):
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
I work for this organization, Vibro, and I am website responsible. We have a sharing box with social icons on everyone of our articles. We want to add the text "del:" (Meaning share in norwegian) in front of the icons in the box. When I went into single.php and added a paragraph element with the text, the code won't be implemented.
Do you have any idea why, and how to fix it?
I've already tried: corrected syntax error, deleted cache and minified css, tried indenting with space and put the p element outside the ul. Does not work! Maybe the changes takes some time to be implemented, I made some changes earlier today that didn't go through before later.
Here's the code in single.php:
<div class="box-social">
<ul class="social social</ul>
<p>Del:</p>
<li>
<a class="circle-icon" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=<?php the_permalink(); ?>"><i class="fa fa-facebook" aria-hidden="true"></i>
</a>
</li>
<li>
<a class="circle-icon" target="_blank" href="https://www.linkedin.com/shareArticle?mini=true&url=<?php the_permalink(); ?>&title=<?php the_title(); ?>&summary=&source="><i class="fa fa-linkedin" aria-hidden="true"></i>
</a>
</li>
<li>
<a class="circle-icon" target="_blank" href="https://twitter.com/home?status=<?php the_permalink(); ?>"><i class="fa fa-twitter" aria-hidden="true">
</i>
</a>
</li>
</ul>
</div>
The code you provided has invalid markup.
You can use something like this https://validator.w3.org/#validate_by_input to validate your html.
One issue with your code is Element p not allowed as child of element ul in this context.
I fixed the broken <ul> and moved the <p> before it.
<div class="box-social">
<p>Del:</p>
<ul class="social social">
<li>
<a class="circle-icon" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=<?php the_permalink(); ?>"><i class="fa fa-facebook" aria-hidden="true"></i>
</a>
</li>
<li>
<a class="circle-icon" target="_blank" href="https://www.linkedin.com/shareArticle?mini=true&url=<?php the_permalink(); ?>&title=<?php the_title(); ?>&summary=&source="><i class="fa fa-linkedin" aria-hidden="true"></i>
</a>
</li>
<li>
<a class="circle-icon" target="_blank" href="https://twitter.com/home?status=<?php the_permalink(); ?>"><i class="fa fa-twitter" aria-hidden="true"></i>
</a>
</li>
</ul>
</div>
I have directory like this "localhost/site/folder1/file.php", I need to access file.php from "site" directory this way
href = "folder1/file.php"
unfortunately it takes me to
href = "folder1/folder1/file.php"
and when I access "index.php" file located in "site" directory from "folder1", this way
href = "../index.php"
it takes me to root directory in c: I mean this way
href = "localhost/index.php".
I have stacked with this problem for two days now, please any one to help me get out this.
Note: I am using bootstrap framework
More edit...
here is the full code.
<section>
<section class="hbox stretch">
<!-- .aside -->
<aside class="bg-black dk nav-xs aside hidden-print" id="nav">
<section class="vbox">
<section class="w-f-md scrollable">
<div class="slim-scroll" data-height="auto" data-disable-fade-out="true" data-distance="0" data-size="10px" data-railOpacity="0.2">
<!-- nav -->
<nav class="nav-primary hidden-xs">
<ul class="nav bg clearfix" data-ride="collapse">
<!--<li class="hidden-nav-xs padder m-t m-b-sm text-xs text-muted">
Discover
</li>-->
<li>
<a href= "../index.php">
<i class="icon-home icon text-success"></i>
<span class="font-bold">Home</span>
</a>
</li>
<li>
<a href="#" class="auto">
<span class="pull-right text-muted">
<i class="fa fa-angle-left text"></i>
<i class="fa fa-angle-down text-active"></i>
</span>
<i class="icon-music-tone-alt icon text-info"></i>
<span class="font-bold">Audios</span>
</a>
<ul class="nav dk text-sm">
<li >
<a href="../general.php" class="auto">
<i class="fa fa-angle-right text-xs"></i>
<span>Speaches</span>
</a>
</li>
<li >
<a href="../general.php" class="auto">
<i class="fa fa-angle-right text-xs"></i>
<span>Preaches</span>
</a>
</li>
<li >
<a href="../general.php" class="auto">
<i class="fa fa-angle-right text-xs"></i>
<span>Interviews</span>
</a>
</li>
<li >
<a href="../general.php" class="auto">
<i class="fa fa-angle-right text-xs"></i>
<span>Songs</span>
</a>
</li>
</ul>
</li>
<li>
<a href="#" class="auto">
<span class="pull-right text-muted">
<i class="fa fa-angle-left text"></i>
<i class="fa fa-angle-down text-active"></i>
</span>
<i class="icon-book-open icon text-primary-lter"></i>
<span class="font-bold">Writtings</span>
</a>
<ul class="nav dk text-sm">
<li >
<a href="../general.php" class="auto">
<i class="fa fa-angle-right text-xs"></i>
<span>Books</span>
</a>
</li>
<li >
<a href="../general.php" class="auto">
<i class="fa fa-angle-right text-xs"></i>
<span>Jounals</span>
</a>
</li>
</ul>
</li>
<li>
<a href="#">
<i class="icon-users icon text-primary-lter"></i>
<span class="font-bold">Artists</span>
</a>
</li>
<li>
<a href="#">
<i class="icon-film icon text-info-dker"></i>
<span class="font-bold">Albums</span>
</a>
</li>
<li class="m-b hidden-nav-xs"></li>
</ul>
<ul class="nav" data-ride="collapse">
<li class="hidden-nav-xs padder m-t m-b-sm text-xs text-muted">
User Account
</li>
<li>
<?php
if(!isset ($_SESSION['email'])){
echo "
<a href='../signin.php' class='auto'>
<i class='icon-login icon'>
</i>
<span>Signin</span>
</a>
</li>
<li >
<a href='../signup.php' class='auto'>
<i class='fa fa-smile-o'>
</i>
<span>Signup</span>
</a>
</li>
";
}else{
echo "
<a href='../signout.php' class='auto'>
<i class='icon-logout icon'>
</i>
<span>SignOut</span>
</a>
</li>";
if (!isset($_SESSION['admin_name'])) {
echo "
<li >
<a href='profile.php' class='auto'>
<i class='fa fa-smile-o'>
</i>
<span>My profile</span>
</a>
</li>
";
}else{
echo "
<li >
<a href='MembersManagement.php' class='auto'>
<i class='fa fa-edit'>
</i>
<span>Manage Member</span>
</a>
</li>
<li >
<a href='admin.php' class='auto'>
<i class='fa fa-edit'>
</i>
<span>My Dashboard</span>
</a>
</li>
";
}
}
?>
</ul>
</nav>
<!-- / nav ---->
</div>
</section>
And the problem is on this line
<nav class="nav-primary hidden-xs">
When I remove "nav-primary" everything is doing fine with the anchors () but it changes the appearance and arrangements in the section, what should I do, I am new to bootstrap frameworks.
If you are having problem with relative urls, you can try doing with absolute urls like :
href = "localhost/site/folder1/file.php".
and for the other one you can do same:
href = "localhost/site/index.php
Maybe this helps.
I need a help in WordPress custom theme using PHP development, I was created language dropdown with images and in configure with Gtranslator Plugin, it`s work properly but when I select other language flag can't change in Dropdown.
my Code is given below:
<li class="dropdown">
<a href="JavaScript:void(0)" class="dropdown-toggle" data-toggle="dropdown"><img class="lang_icon" src="<?php echo get_stylesheet_directory_uri();?>/images/usaicon.png">
<i class="fa fa-angle-down" aria-hidden="true"></i>
</a>
<ul class="dropdown-menu dropdown_language">
<li><a onclick="doGTranslate('en|en')" href="JavaScript:void(0)">
<img class="lang_icon" src="<?php echo get_stylesheet_directory_uri();?>/images/usaicon.png">
</a>
</li>
<li id="cn"><a onclick="doGTranslate('en|zh-CN')" href="JavaScript:void(0)">
<img class="lang_icon" src="<?php echo get_stylesheet_directory_uri();?>/images/chinaicon.png">
</a>
</li>
<li><a onclick="doGTranslate('en|es')" href="JavaScript:void(0)">
<img class="lang_icon" src="<?php echo get_stylesheet_directory_uri();?>/images/mexiconicon.png">
</a>
</li>
</ul>
</li>
I have a code I am developing but now I'm Stuck as I'm new to PHP.
When I use simple quotation marks it works but, I think this code is a little ugly and strange, I would like someone to review.
Code:
<?php echo"
<li class='light-blue'>
<a data-toggle='dropdown' href='#' class='dropdown-toggle'>
<img class='nav-user-photo' src='../upload/avatar/$arqDir'>".$_SESSION['img'].">
<span class='user-info'>
<small>Bem Vindo,</small>
echo ".$_SESSION['nome'].";
</span>
<i class='ace-icon fa fa-caret-down'></i>
</a>
<ul class='user-menu dropdown-menu-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close'>
<li>
<a href='#'>
<i class='ace-icon fa fa-cog'></i>
Cofigurações
</a>
</li>
<li>
<a href='profile.html'>
<i class='ace-icon fa fa-user'></i>
Perfil
</a>
</li>
<li class='divider'></li>
<li>
<a href='logout.php'>
<i class='ace-icon fa fa-power-off'></i>
Sair
</a>
</li>
</ul>
</li>";
?>
As AbraCadaver said, this is one way it could be done:
<li class="light-blue">
<a data-toggle="dropdown" href="#" class="dropdown-toggle">
<img class="nav-user-photo" src="../upload/avatar/<?php echo $arqDir . "/" . $_SESSION['img'];?>">
<span class="user-info">
<small>Bem Vindo,</small>
<?php echo $_SESSION['nome']; ?>
</span>
<i class="ace-icon fa fa-caret-down"></i>
</a>
<ul class="user-menu dropdown-menu-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close">
<li>
<a href="#">
<i class="ace-icon fa fa-cog"></i>
Cofigurações
</a>
</li>
<li>
<a href="profile.html">
<i class="ace-icon fa fa-user"></i>
Perfil
</a>
</li>
<li class="divider"></li>
<li>
<a href="logout.php">
<i class="ace-icon fa fa-power-off"></i>
Sair
</a>
</li>
</ul>
</li>
And another way could be:
<?php
echo '
<li class="light-blue">
<a data-toggle="dropdown" href="#" class="dropdown-toggle">
<img class="nav-user-photo" src="../upload/avatar/'. $arqDir . '/' . $_SESSION['img'].'">
<span class="user-info">
<small>Bem Vindo,</small>
'.$_SESSION['nome'].'
</span>
<i class="ace-icon fa fa-caret-down"></i>
</a>
<ul class="user-menu dropdown-menu-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close">
<li>
<a href="#">
<i class="ace-icon fa fa-cog"></i>
Cofigurações
</a>
</li>
<li>
<a href="profile.html">
<i class="ace-icon fa fa-user"></i>
Perfil
</a>
</li>
<li class="divider"></li>
<li>
<a href="logout.php">
<i class="ace-icon fa fa-power-off"></i>
Sair
</a>
</li>
</ul>
</li>';
In order to remove any confusion, use double quotes in your echo statements and use necessary escaping. For example
echo "<div class=\"boy\"> </div>";
OR
echo"<li class=\"boy\"> </li>";
The class name 'boy' was with double quotes too , so we just escaped it with backlash.
In case when you want to use arrays you just need to close and open quotes when required. For example
echo "The user is: ".$row['user'].":";
The above line will output something like:
The user is: user:
<?php echo"
<li class=\"light-blue\">
<a data-toggle=\"dropdown\" href=\"#\" class=\"dropdown-toggle\">
<img class=\"nav-user-photo\" src=\"../upload/avatar/$arqDir\"".$_SESSION['img'].">
<span class=\"user-info\">
<small>Bem Vindo,</small>
".$_SESSION['nome'].";
</span>
<i class=\"ace-icon fa fa-caret-down\"></i>
</a>
<ul class=\"user-menu dropdown-menu-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close\">
<li>
<a href=\"#\">
<i class=\"ace-icon fa fa-cog\"></i>
Cofigurações
</a>
</li>
<li>
<a href=\"profile.html\">
<i class=\"ace-icon fa fa-user\"></i>
Perfil
</a>
</li>
<li class=\"divider\"></li>
<li>
<a href=\"logout.php\">
<i class=\"ace-icon fa fa-power-off\"></i>
Sair
</a>
</li>
</ul>
</li>";
?>
I have tried to review and edit code accordingly. I hope you get this.
Three method as I know is:
1. <?php echo $variable; ?>
2.
<?php
echo " $variable ";
?>
3.
<?php
echo <<< LINK
$variable
LINK;
...
?>
I prefered third solutions. In my opinion is the most clear.
In your case should looks like:
echo <<< html
<li class='light-blue'>
<a data-toggle='dropdown' href='#' class='dropdown-toggle'>
<img class='nav-user-photo' src='../upload/avatar/$arqDir'>$_SESSION[img]>
<span class='user-info'>
<small>Bem Vindo,</small>
$_SESSION[nome]
</span>
<i class='ace-icon fa fa-caret-down'></i>
</a>
<ul class='user-menu dropdown-menu-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close'>
<li>
<a href='#'>
<i class='ace-icon fa fa-cog'></i>
Cofigurações
</a>
</li>
<li>
<a href='profile.html'>
<i class='ace-icon fa fa-user'></i>
Perfil
</a>
</li>
<li class='divider'></li>
<li>
<a href='logout.php'>
<i class='ace-icon fa fa-power-off'></i>
Sair
</a>
</li>
</ul>
</li>
html;