index.php not linking to single.php single page post - php

Hello guys I'm working on a wordpress theme/template and I'm having problems when clicking on blog post title in index.html. It will redirect me to correct link on address bar however, single.php is not displaying anything. I'm not sure if the page is getting called or what's actually going on. If you can weight your 2cents thanks here's the link to wordpress blog: http://pctechtips.org/testblog
index.php
<?php get_header(); ?>
<!-- jumbotron -->
<div class="jumbotron jumbotron-fluid">
<div class="container">
<h1 class="display-4"><?php bloginfo('name'); ?></h1>
<p class="lead"><?php bloginfo('description'); ?></p>
</div>
</div>
<!-- /jumbotron -->
<!-- Page Content -->
<div class="container">
<div class="row">
<!-- Blog Entries Column -->
<div class="col-md-8">
<?php if(have_posts()) : ?>
<?php while(have_posts()) : the_post(); ?>
<!-- Blog Post -->
<div class="mb-4">
<div class="card-body">
<a href="<?php the_permalink(); ?>">
<h2 class="card-title"><?php the_title(); ?></h2>
</a>
<p class="blog-post-meta">
<?php echo Date('M d, Y'); ?> by <?php the_author(); ?>
</p>
<!-- feature image -->
<?php if(has_post_thumbnail()) : ?>
<div class="post-thumb">
<?php the_post_thumbnail(); ?>
</div>
<?php endif; ?>
<p class="card-text"><?php the_excerpt(); ?></p>
</div>
</div>
<?php endwhile; ?>
<?php else : ?>
<p><?php __('No Post Found!'); ?></p>
<?php endif; ?>
<!-- Pagination -->
<ul class="pagination justify-content-center mb-4">
<li class="page-item">
<a class="page-link" href="#">← Older</a>
</li>
<li class="page-item disabled">
<a class="page-link" href="#">Newer →</a>
</li>
</ul>
</div>
<!-- Sidebar Widgets Column -->
<div class="col-md-4">
<!-- Search Widget -->
<div class="card my-4">
<h5 class="card-header">Search</h5>
<div class="card-body">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search for...">
<span class="input-group-btn">
<button class="btn btn-secondary" type="button">Go!</button>
</span>
</div>
</div>
</div>
<!-- Categories Widget -->
<div class="card my-4">
<h5 class="card-header">Categories</h5>
<div class="card-body">
<div class="row">
<div class="col-lg-6">
<ul class="list-unstyled mb-0">
<li>
Web Design
</li>
<li>
HTML
</li>
<li>
Freebies
</li>
</ul>
</div>
<div class="col-lg-6">
<ul class="list-unstyled mb-0">
<li>
JavaScript
</li>
<li>
CSS
</li>
<li>
Tutorials
</li>
</ul>
</div>
</div>
</div>
</div>
<!-- Side Widget -->
<div class="card my-4">
<h5 class="card-header">Side Widget</h5>
<div class="card-body">
You can put anything you want inside of these side widgets. They are easy to use, and feature the new Bootstrap 4 card containers!
</div>
</div>
</div>
</div>
<!-- /.row -->
</div>
<!-- /.container -->
<?php get_footer(); ?>
single.php
<?php get_header(); ?>
<!-- jumbotron -->
<div class="jumbotron jumbotron-fluid">
<div class="container">
<h1 class="display-4"><?php bloginfo('name'); ?></h1>
<p class="lead"><?php bloginfo('description'); ?></p>
</div>
</div>
<!-- /jumbotron -->
<!-- Page Content -->
<div class="container">
<div class="row">
<!-- Blog Entries Column -->
<div class="blog-post col-md-8">
<?php if(have_posts()) : ?>
<?php while(have_posts()) : the_post(); ?>
<!-- Blog Post -->
<div class="blog-post-title mb-4">
<h2 class="card-title"><?php the_title(); ?></h2>
<p class="blog-post-meta">
<?php echo Date('M d, Y'); ?> by <?php the_author(); ?>
</p>
<!-- feature image -->
<?php if(has_post_thumbnail()) : ?>
<div class="post-thumb">
<?php the_post_thumbnail(); ?>
</div>
<?php endif; ?>
<p class="card-text"><?php the_content(); ?></p>
<hr>
<!-- comments -->
<?php comments_templates(); ?>
</div>
<?php endwhile; ?>
<?php else : ?>
<p><?php __('No Post Found!'); ?></p>
<?php endif; ?>
<!-- Pagination -->
<ul class="pagination justify-content-center mb-4">
<li class="page-item">
<a class="page-link" href="#">← Older</a>
</li>
<li class="page-item disabled">
<a class="page-link" href="#">Newer →</a>
</li>
</ul>
</div>
<!-- Sidebar Widgets Column -->
<div class="col-md-4">
<!-- Search Widget -->
<div class="card my-4">
<h5 class="card-header">Search</h5>
<div class="card-body">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search for...">
<span class="input-group-btn">
<button class="btn btn-secondary" type="button">Go!</button>
</span>
</div>
</div>
</div>
<!-- Categories Widget -->
<div class="card my-4">
<h5 class="card-header">Categories</h5>
<div class="card-body">
<div class="row">
<div class="col-lg-6">
<ul class="list-unstyled mb-0">
<li>
Web Design
</li>
<li>
HTML
</li>
<li>
Freebies
</li>
</ul>
</div>
<div class="col-lg-6">
<ul class="list-unstyled mb-0">
<li>
JavaScript
</li>
<li>
CSS
</li>
<li>
Tutorials
</li>
</ul>
</div>
</div>
</div>
</div>
<!-- Side Widget -->
<div class="card my-4">
<h5 class="card-header">Side Widget</h5>
<div class="card-body">
You can put anything you want inside of these side widgets. They are easy to use, and feature the new Bootstrap 4 card containers!
</div>
</div>
</div>
</div>
<!-- /.row -->
</div>
<!-- /.container -->
<?php get_footer(); ?>

Related

How can I add an if statement to display conditional HTML using PHP without using the echo function

I am trying to display a piece of HTML code I added to a WordPress website but I do not want to use the echo function as it affects the loop. I had to use a WP_query which works in a certain way to get what I want to do. My code works great but I don't want it on certain pages.
This is what I have tried so far
<?php
if(!is_front_page()){
<div class="slider-container">
<h4 class="slider-header">
<span class="slider-header_text">Trending</span>
</h4>
<div class="slider">
<div class="carousel-container">
<div class="carousel-inner">
<div class="track">
<!--Beginning of responsive slider-->
<?php $custom_query = new WP_Query(array(
'posts_per_page' => 12,
'category_name' => 'featured-posts',
));
while($custom_query->have_posts()) : $custom_query->the_post(); ?>
<div class="card-container">
<a href="<?php the_permalink(); ?>" class="card">
<div class="img">
<img src="<?php the_post_thumbnail_url('thumbnail'); ?>" alt="">
</div>
<div class="info">
<h5><?php the_title(); ?></h5>
</div>
</a>
</div>
<?php endwhile; ?>
<?php wp_reset_postdata(); // reset the query ?>
</div>
</div>
<div class="nav">
<button class="prev">
<i class="fas fa-angle-left"></i>
</button>
<button class="next">
<i class="fas fa-angle-right"></i>
</button>
</div>
</div>
</div>
</div>
}
?>
But this immediately throws an error.
I haven't checked if your code works. But the provided code without syntax errors would be:
<?php
if (!is_front_page()) {
?>
<div class="slider-container">
<h4 class="slider-header">
<span class="slider-header_text">Trending</span>
</h4>
<div class="slider">
<div class="carousel-container">
<div class="carousel-inner">
<div class="track">
<!--Beginning of responsive slider-->
<?php $custom_query = new WP_Query(array(
'posts_per_page' => 12,
'category_name' => 'featured-posts',
));
while ($custom_query->have_posts()) : $custom_query->the_post(); ?>
<div class="card-container">
<a href="<?php the_permalink(); ?>" class="card">
<div class="img">
<img src="<?php the_post_thumbnail_url('thumbnail'); ?>" alt="">
</div>
<div class="info">
<h5><?php the_title(); ?></h5>
</div>
</a>
</div>
<?php endwhile; ?>
<?php wp_reset_postdata(); // reset the query
?>
</div>
</div>
<div class="nav">
<button class="prev">
<i class="fas fa-angle-left"></i>
</button>
<button class="next">
<i class="fas fa-angle-right"></i>
</button>
</div>
</div>
</div>
</div>
<?php } ?>

WordPress loop, search results

looking for a steer in the right direction getting this loop working. I'm nearly there but not 100% as I've got a mysterious box appearing at the top and the bottom of the search results. Would anyone be able to check over to see if the loop is right, please?
I've tried jigging the loop around but can't make any sense of it.
<?php get_header(); ?>
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-body">
<p class="text-muted text-size-small">
<?php
global $wp_query;
echo 'You have '.$wp_query->found_posts.' results found.';?>
</p>
<hr>
<?
php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<div class="media-body">
<h6 class="media-heading text-semibold">
<?php echo get_post_meta(get_the_id(), 'title', true ); ?>,
<?php echo get_post_meta(get_the_id(), 'firstname', true ); ?>,
<?php echo get_post_meta(get_the_id(), 'lastname', true ); ?>
</h6>
<ul class="list-inline list-inline-separate text-muted mb-10">
<li><a href="#" class="text-muted">
<?php echo get_post_meta( get_the_id(), 'type', true ); ?>
</a> </li>
<li><?php echo get_post_meta(get_the_id(), 'netbios_name', true ); ?> |
<?php echo get_post_meta(get_the_id(), 'device_class', true ); ?></li>
</ul>
<?php echo get_post_meta( get_the_id(), 'asset_id', true ); ?>
<?php echo get_post_meta(get_the_id(), 'asset_status', true ); ?>
</div>
<div class="media-right text-nowrap">
<a href="<?php the_permalink();?>"
class="btn btn-warning">View</a>
</div>
</li>
<ul class="media-list content-group">
<li class="media panel panel-body stack-media-on-mobile">
<div class="media-left">
<a href="#">
<img src="assets/images/demo/brands/dell.png" class="img-rounded img-lg" alt="">
</a>
</div>
<?php endwhile; ?>
<?php endif; ?>
</div>
</div>
</div>
</div>
<?php get_template_part('footer', 'simple');?>
<?php get_footer(); ?>
Here's what the HTML view is spitting out
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-body">
<p class="text-muted text-size-small">
You have 3 results found. </p>
<hr>
<div class="media-body">
<h6 class="media-heading text-
semibold">
, , </h6>
<ul class="list-inline list-inline-
separate text-muted mb-10">
<li><a href="#" class="text-
muted"> </a></li>
<li> | </li>
</ul>
</div>
<div class="media-right text-nowrap">
View
</div>
</li>
<ul class="media-list content-group">
<li class="media panel panel-body stack-
media-on-mobile">
<div class="media-left">
<a href="#">
<img src=" class="img-rounded
img-lg" alt="">
</a>
</div>
<div class="media-body">
<h6 class="media-heading text-
semibold">
34
, , </h6>
<ul class="list-inline list-inline-
separate text-muted mb-10">
<li><a href="#" class="text-
muted"> </a></li>
<li> | </li>
</ul>
</div>
<div class="media-right text-nowrap">
<a href="" class="btn btn-
warning">View</a>
</div>
</li>
<ul class="media-list content-group">
<li class="media panel panel-body stack-
media-on-mobile">
<div class="media-left">
<a href="#">
<img src=" class="img-rounded
img-lg" alt="">
</a>
</div>
<div class="media-body">
<h6 class="media-heading text-
semibold">
34
Mr, User, User </h6>
<ul class="list-inline list-inline-separate text-muted mb-10">
<li>User </li>
<li> | </li>
</ul>
</div>
<div
class="media-right text-nowrap">
View
</div>
</li>
<ul class="media-list content-group">
<li class="media
panel panel-body stack-media-on-mobile">
<div
class="media-left">
<a
href="#">
<img src=" class="img-rounded img-lg" alt="">
</a>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- /main content -->
</div>
<!-- /page content -->
/div>
<!-- /page container -->

Why does not get_field() in WordPress work when I transfer the code to template part

I am getting mad
I had those variables
$wwa_section_title = get_field('wwa_section_title');
$wwa_section_description = get_field('wwa_section_description');
$wwa_section_body = get_field('wwa_section_body');
$wwa_section_image_1 = get_field('wwa_section_image_1');
$wwa_section_image_2 = get_field('wwa_section_image_2')
And this is the HTML section
<div class="container-fluid about-company">
<div class="container">
<div class="row">
<div class="col-xs-12 hero-title text-center">
<h2 class="text-capitalize">
<?php
echo $wwa_section_title;
?>
</h2>
<p class="hero-paragraph">
<?php
echo $wwa_section_body;
?>
</p>
</div>
</div>
</div>
<div class="row">
<div class="col-md-7">
<div class="row">
<div class="col-xs-4 col-xs-offset-4">
<img src="<?php echo $wwa_section_image_2['url'];?>" alt="" class="img-responsive">
</div>
<div class="col-xs-4">
<img src="<?php echo $wwa_section_image_1['url'];?>" alt="" class="img-responsive">
</div>
</div>
<div class="row">
<div class="col-xs-8 col-xs-offset-4">
<p class="about-paragraph small">
<?php
echo $wwa_section_description;
?>
</p>
</div>
</div>
<div class="row">
<div class="col-xs-4 col-xs-offset-4">
<ul class="about-us-list">
<li class="about-us-list-item">
<div class="about-list-item-check">
<i class="icofont icofont-checked"></i>
</div>
<div class="about-list-item-text">Ipsum is simply text of the stry simply</div>
</li>
<li class="about-us-list-item">
<div class="about-list-item-check">
<i class="icofont icofont-checked"></i>
</div>
<div class="about-list-item-text">Dummy text of the print</div>
</li>
<li class="about-us-list-item">
<div class="about-list-item-check">
<i class="icofont icofont-checked"></i>
</div>
<div class="about-list-item-text">Ipsum is simply text of the stry simply</div>
</li>
<li class="about-us-list-item">
<div class="about-list-item-check">
<i class="icofont icofont-checked"></i>
</div>
<div class="about-list-item-text">Dummy text of the print</div>
</li>
<li class="about-us-list-item">
<div class="about-list-item-check">
<i class="icofont icofont-checked"></i>
</div>
<div class="about-list-item-text">Ipsum is simply text of the stry simply</div>
</li>
</ul>
</div>
<div class="col-xs-4">
<ul class="about-us-list">
<li class="about-us-list-item">
<div class="about-list-item-check">
<i class="icofont icofont-checked"></i>
</div>
<div class="about-list-item-text">Ipsum is simply text of the stry simply</div>
</li>
<li class="about-us-list-item">
<div class="about-list-item-check">
<i class="icofont icofont-checked"></i>
</div>
<div class="about-list-item-text">Dummy text of the print</div>
</li>
<li class="about-us-list-item">
<div class="about-list-item-check">
<i class="icofont icofont-checked"></i>
</div>
<div class="about-list-item-text">Ipsum is simply text of the stry simply</div>
</li>
<li class="about-us-list-item">
<div class="about-list-item-check">
<i class="icofont icofont-checked"></i>
</div>
<div class="about-list-item-text">Dummy text of the print</div>
</li>
<li class="about-us-list-item">
<div class="about-list-item-check">
<i class="icofont icofont-checked"></i>
</div>
<div class="about-list-item-text">Ipsum is simply text of the stry simply</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
When I transfer this code into a template part and try to render it, the variables become empty.
Once I role back and return the whole code into the page template it wotks fine
I tried to use $post->ID and did not work
I tried to use the_field() instead and did not work
You don't explain at which place in your code you initialize your variables, so I can just guess what might be the problem.
The get_field function of ACF can be called with $post_id as second parameter. If you don't add that one, the get_field call should be inside The Loop.
Finally, I found the solution!!!
I did not use wp_reset_query() after the last while of the section that is before this section (about section which code in the question)
when I added
<? endwhile; wp_reset_query(); ?>
the problem resolved

Bootstrap side navbar doesn't work when I have includes (PHP)

My code works just fine if it is in html file, the header and footer codes are in the products page. The problem is if I make it in php file, the side navbar won't work, I already tried moving the body tag in the products page but it still doesn't work. Appreciate any help :)
header-ee.php
<html>
<head>
<?php
include('parameters.php');
?>
<title> <?php echo $page_title; ?> </title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="<?= $server_addr ?>/common/css/bootstrap.css">
<script src="<?= $server_addr ?>/common/js/jquery-3.2.1.js"></script>
<script src="<?= $server_addr ?>/common/js/bootstrap.js"></script>
<script src="js/ee-home.js"></script>
<link rel="stylesheet" href="css/ee-home.css">
</head>
<body data-spy="scroll" data-target="#myScrollspy" data-offset="20">
<!--Start header-->
<nav class="navbar navbar-default navigation-bar">
<div class="container-fluid">
<div class="row">
<div class="navbar-header col-xs-12 col-sm-12 col-md-12 col-lg-6 centered-a">
<div class="row">
<div class="col-sm-3 centered-a">
<img src="img/ee-logo.png">
</div>
<div class="col-sm-9">
<h1 id="nav-brand">
EQUIPMENT ENGINEERS, INC.</br>
</h1>
<h1 id="nav-brand-subtitle">
<small>
Your Reliable Solutions Partner
</small>
</h1>
</div>
</div>
<a href="#">
<span class="link-spanner"></span>
</a>
</div>
<div class="navbar-header col-lg-6 visible-lg centered-a">
<div class="row centered-a" id="nav-box">
<div class="col-lg-2 centered-a">
<a href="#">
<p>Home</p>
<span class="link-spanner"></span>
<a>
</div>
<div class="col-lg-2 centered-a">
<a href="#">
<p>Our Company</p>
<span class="link-spanner"></span>
<a>
</div>
<div class="col-lg-2 centered-a">
<a href="#">
<p>SCM</p>
<span class="link-spanner"></span>
<a>
</div>
<div class="col-lg-2 centered-a">
<a href="#">
<p>Products</p>
<span class="link-spanner"></span>
<a>
</div>
<div class="col-lg-2 centered-a">
<a href="#">
<p>Inquiries</p>
<span class="link-spanner"></span>
<a>
</div>
<div class="col-lg-2 centered-a" id="last-item">
<a href="#">
<p">Supplier Accreditation</p>
<span class="link-spanner"></span>
<a>
</div>
</div>
</div>
</div>
<div class="panel-group col-md-12 centered-a hidden-lg">
<div class="panel panel-default">
<div class="panel-heading" >
<h2 class="panel-title centered-a">
<span class="glyphicon glyphicon-triangle-bottom"></span>
<a data-toggle="collapse" href="#collapse1">
<span class="link-spanner"></span>
<a>
</h2>
</div>
<div id="collapse1" class="panel-collapse collapse">
<ul class="list-group">
<li class="list-group-item">
Home
<span class="link-spanner"></span>
</li>
<li class="list-group-item">
Our Company
<span class="link-spanner"></span>
</li>
<li class="list-group-item">
SCM
<span class="link-spanner"></span>
</li>
<li class="list-group-item">
Products
<span class="link-spanner"></span>
</li>
<li class="list-group-item">
Inquiries
<span class="link-spanner"></span>
</li>
<li class="list-group-item">
Supplier Accreditation
<span class="link-spanner"></span>
</li>
</ul>
</div>
</div>
</div>
</div>
</nav>
<!--End header-->
products.php
<?php include("includes/header-ee.php"); ?>
<link rel="stylesheet" href="products.css"></link>
<div class="container-fluid">
<div class="row">
<!--Sidebar-->
<nav class="col-md-3" id="myScrollspy">
<span>Product Lineup</span>
<ul class="nav nav-pills nav-stacked">
<li class="active">Section 1</li>
<li>Section 2</li>
<li>Section 3</li>
</ul>
</nav>
<!--Content-->
<div class="col-md-9">
<div id="section1">
<div class="bg-franklin bg-img centered-a">
<div class="caption" style="border:10px; border-color:white;">
<img src="img/products/franklin.png" style="width:50%; background-color:white;"></img>
</div>
</div>
<p style="margin-left:10px; margin-right:10px; font-size: 1.2em; text-align:left;padding: 0% 3%;">
</br>
</br></br>
</br></br>
</p>
</div>
<div id="section2">
<div class="bg-franklin bg-img centered-a">
<div class="caption" style="border:10px; border-color:white;">
<img src="img/products/franklin.png" style="width:50%; background-color:white;"></img>
</div>
</div>
<p style="margin-left:10px; margin-right:10px; font-size: 1.2em; text-align:left;padding: 0% 3%;">
</br>
</br></br>
</br></br>
</p>
</div>
</div>
</div>
</div>
<?php include("includes/footer-ee.php"); ?>
footer-ee.php
</body>
<footer>
<div class="footer-blk row">
<div style="float: none;text-align: center;">
Home | Terms and Conditions | Privacy Policy
</div>
<div style="float: none;text-align: center;">
</div>
</div>
</footer>

Navbar doesnt look very well

The problem is following
I create a PHP (CodeIgniter) project and want to construct Home Page
view/pages/home.php and over here I have this code:
Home.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Car Sharing</title>
<!-- Bootstrap Core CSS -->
<link href="assets/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Additional fonts for this theme -->
<link href="assets/lib/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Merriweather:400,300,300italic,400italic,700,700italic,900,900italic' rel='stylesheet' type='text/css'>
<!-- Plugin CSS -->
<link href="assets/lib/magnific-popup/magnific-popup.css" rel="stylesheet">
<!-- Theme CSS -->
<link href="assets/css/creative.min.css" rel="stylesheet">
</head>
<body id="page-top">
<header>
<div class="header-content">
<div class="header-content-inner">
<h1 id="homeHeading">Putujmo Zajedno</h1>
<hr>
<p>Tražiš prevoz?</p>
<p>ili samo putuješ negdje?</p>
Postavi Oglas
</div>
</div>
</header>
<section class="bg-primary" id="about">
<div class="container">
<div class="row">
<div class="col-lg-8 offset-lg-2 text-center">
<h2 class="section-heading text-white">We've got what you need!</h2>
<hr class="light">
<p class="text-faded">Putujmo zajedno - web stranica je naredni korak razvijanja ideje o djeljenju prevoza (carpooling) u Bosni i Hercegovini ali i šire, započeta putem društvene mreže Facebook od strane nekoliko aktivista i volontera.
Za nešto više od godinu dana, grupa na Facebook mreži je prešla 12 000 članova, sa nekoliko stotina oglasa mjesečno. Ovaj broj u razvoju saobraćajnih sistema predstavlja broj korisnika koji svojim prisustvom imaju potrebu za novim načinom prevoza, te organizovanja i komuniciranja unutar istog. To je bio još jedan razlog za pokretanje ove web stranice koja ima za cilj da olakša postavljanje oglasa za nuđenje i traženje prevoza, kao i pregled već postavljenih oglasa.
Uzevši u obzir da su ovo pionirski koraci na našim prostorima, otvoreni smo za sve prijedloge, kritike i svakako pohvale. Cijeli projekat dijeljenja prevoza je zasnovan na volonterskom radu i resursima pojedinaca, tako da je svaka vrsta podrške više nego dobrodošla.
Pored ove web stranice, grupa "Tražim- nudim prevoz" na Facebooku ostaje i dalje aktivna i operativna.</p>
</div>
</div>
</div>
</section>
<section id="services">
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<h2 class="section-heading">ZAŠTO PODIJELITI VOŽNJU?</h2>
<hr class="primary">
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-lg-3 col-md-6 text-center">
<div class="service-box">
<i class="fa fa-4x fa-diamond text-primary sr-icons"></i>
<h3>Jeftinije je</h3>
</div>
</div>
<div class="col-lg-3 col-md-6 text-center">
<div class="service-box">
<i class="fa fa-4x fa-paper-plane text-primary sr-icons"></i>
<h3>Brinemo o životnoj sredini</h3>
</div>
</div>
<div class="col-lg-3 col-md-6 text-center">
<div class="service-box">
<i class="fa fa-4x fa-newspaper-o text-primary sr-icons"></i>
<h3>Brze je</h3>
</div>
</div>
<div class="col-lg-3 col-md-6 text-center">
<div class="service-box">
<i class="fa fa-4x fa-heart text-primary sr-icons"></i>
<h3>Društvenije je</h3>
</div>
</div>
</div>
</div>
</section>
<section class="no-padding" id="portfolio">
<div class="container-fluid">
<div class="row no-gutter popup-gallery">
<div class="col-lg-4 col-sm-6">
<a href="assets/images/HomePage/portfolio/fullsize/Beograd.jpg" class="portfolio-box">
<img src="assets/images/HomePage/portfolio/fullsize/Beograd.jpg" class="img-fluid" alt="">
<div class="portfolio-box-caption">
<div class="portfolio-box-caption-content">
<div class="project-category text-faded">
Beograd
</div>
</div>
</div>
</a>
</div>
<div class="col-lg-4 col-sm-6">
<a href="assets/images/HomePage/portfolio/fullsize/Novi Sad.jpg" class="portfolio-box">
<img src="assets/images/HomePage/portfolio/fullsize/Novi Sad.jpg" class="img-fluid" alt="">
<div class="portfolio-box-caption">
<div class="portfolio-box-caption-content">
<div class="project-category text-faded">
Novi Sad
</div>
</div>
</div>
</a>
</div>
<div class="col-lg-4 col-sm-6">
<a href="assets/images/HomePage/portfolio/fullsize/Sarajevoo.jpg" class="portfolio-box">
<img src="assets/images/HomePage/portfolio/fullsize/Sarajevoo.jpg" class="img-fluid" alt="">
<div class="portfolio-box-caption">
<div class="portfolio-box-caption-content">
<div class="project-category text-faded">
Sarajevo
</div>
</div>
</div>
</a>
</div>
<div class="col-lg-4 col-sm-6">
<a href="assets/images/HomePage/portfolio/fullsize/Zagreb.jpg" class="portfolio-box">
<img src="assets/images/HomePage/portfolio/fullsize/Zagreb.jpg" class="img-fluid" alt="">
<div class="portfolio-box-caption">
<div class="portfolio-box-caption-content">
<div class="project-category text-faded">
Zagreb
</div>
</div>
</div>
</a>
</div>
<div class="col-lg-4 col-sm-6">
<a href="assets/images/HomePage/portfolio/fullsize/Ljubljana.jpg" class="portfolio-box">
<img src="assets/images/HomePage/portfolio/fullsize/Ljubljana.jpg" class="img-fluid" alt="">
<div class="portfolio-box-caption">
<div class="portfolio-box-caption-content">
<div class="project-category text-faded">
Ljubljana
</div>
</div>
</div>
</a>
</div>
<div class="col-lg-4 col-sm-6">
<a href="assets/images/HomePage/portfolio/fullsize/Wien.jpg" class="portfolio-box">
<img src="assets/images/HomePage/portfolio/fullsize/Wien.jpg" class="img-fluid" alt="">
<div class="portfolio-box-caption">
<div class="portfolio-box-caption-content">
<div class="project-category text-faded">
Wien
</div>
</div>
</div>
</a>
</div>
</div>
</div>
</section>
<aside class="bg-dark">
<div class="container text-center">
<div class="call-to-action">
</div>
</div>
</aside>
<section id="contact">
<div class="container">
<div class="row">
<div class="col-lg-8 offset-lg-2 text-center">
<h2 class="section-heading">Let's Get In Touch!</h2>
<hr class="primary">
<p>Ready to start your next trip with us? That's great! Give us a call or send us an email and we will get back to you as soon as possible!</p>
</div>
<div class="col-lg-4 offset-lg-2 text-center">
<i class="fa fa-phone fa-3x sr-contact"></i>
<p>062/266-198</p>
</div>
<div class="col-lg-4 text-center">
<i class="fa fa-envelope-o fa-3x sr-contact"></i>
<p>demirmahmutovic#gmail.com</p>
</div>
</div>
</div>
</section>
<script src="assets/lib/jquery/jquery.js"></script>
<script src="assets/lib/tether/tether.min.js"></script>
<script src="assets/lib/bootstrap/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script>
<script src="assets/lib/scrollreveal/scrollreveal.min.js"></script>
<script src="assets/lib/magnific-popup/jquery.magnific-popup.min.js"></script>
<script src="assets/js/creative.min.js"></script>
</body>
</html>
And also I have header/footer which is contructed, the code is belowe for header
Header.php
<html>
<head>
<title>Car Sharing</title>
<link rel="stylesheet" href="https://bootswatch.com/darkly/bootstrap.min.css"/>
<link rel="stylesheet" href="<?php echo base_url()?>assets/css/style.css">
</head>
<body>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="<?php echo base_url()?>pages/home">Car Sharing</a>
</div>
<ul class="nav navbar-nav">
<?php if($this->session->userdata('logged_in')):?>
<li>Postavi Oglas</li>
<li>Postavi Kategoriju</li>
<li>Kategorije</li>
<li>Sve voznje</li>
<li>O nama</li>
<li>Contact</li>
<li>Log out</li>
<?php endif;?>
</ul>
<ul class="nav navbar-nav navbar-right">
<?php if(!$this->session->userdata('logged_in')):?>
<li><span class="glyphicon glyphicon-user"></span> Registruj Se</li>
<li><span class="glyphicon glyphicon-log-in"></span> Login</li>
<?php endif ;?>
</ul>
</div>
</nav>
<div class="container">
<?php if($this->session->flashdata('user_registred')):?>
<?php echo '<p class="alert alert-success">'.$this->session->flashdata('user_registred').'</p>'?>
<?php endif;?>
<?php if($this->session->flashdata('post_created')):?>
<?php echo '<p class="alert alert-success">'.$this->session->flashdata('post_created').'</p>'?>
<?php endif;?>
<?php if($this->session->flashdata('post_updated')):?>
<?php echo '<p class="alert alert-success">'.$this->session->flashdata('post_updated').'</p>'?>
<?php endif;?>
<?php if($this->session->flashdata('category_creted')):?>
<?php echo '<p class="alert alert-success">'.$this->session->flashdata('category_created').'</p>'?>
<?php endif;?>
<?php if($this->session->flashdata('post_deleted')):?>
<?php echo '<p class="alert alert-success">'.$this->session->flashdata('post_deleted').'</p>'?>
<?php endif;?>
<?php if($this->session->flashdata('login_failed')):?>
<?php echo '<p class="alert alert-danger">'.$this->session->flashdata('login_failed').'</p>'?>
<?php endif;?>
<?php if($this->session->flashdata('user_loggedin')):?>
<?php echo '<p class="alert alert-success">'.$this->session->flashdata('user_loggedin').'</p>'?>
<?php endif;?>
<?php if($this->session->flashdata('user_loggedout')):?>
<?php echo '<p class="alert alert-success">'.$this->session->flashdata('user_loggedout').'</p>'?>
<?php endif;?>
<?php if($this->session->flashdata('category_deleted')):?>
<?php echo '<p class="alert alert-success">'.$this->session->flashdata('category_deleted').'</p>'?>
<?php endif;?>
And output of these two look like this:
When I delete my header/footer.php file my other web-site tabs are without css.
What I need to do to make Home Page normal
try to wrap your ul with navbar-collapse collapse
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="<?php echo base_url()?>pages/home">Car Sharing</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<!-- -->
</ul>
<ul class="nav navbar-nav navbar-right">
<!-- -->
</ul>
</div>
</div>
</nav>
also make sure your li have following properties applied
.navbar-nav > li {
float: left;
}

Categories