I'm having trouble with the Blog portion of my project I'm working on. I have made a new template and pointed the Blog page to that template but no posts show up on the page. I have also went under Reading > and changed the Posts Page to Blog, the whole page doesn't show up. Below is the code and a link:
http://www.hbaofwashingtoncounty.org/hbawc2014/blog/
<?php
/*
Template Name: Blog
*/
;?>
<?php get_header();?>
<div class="inner">
<!-- Content Section Start -->
<div class="contentsec-new twocol">
<!-- Top Header Start -->
<div class="topheader">
<div class="inner">
<!-- Logo Start -->
<div class="logo">
<a href="<?php echo home_url();?>">
<?php if($logo_img = $_extracoding->set_value('LOGO', get_template_directory_uri().'/images/logo.png', true)): ?>
<img src="<?php echo $logo_img;?>" alt="<?php bloginfo('name');?>" id="logo" />
<?php else:?>
<span class="logo"> </span>
<?php endif;?>
</a>
</div>
<!-- Logo End -->
<!-- Right Header Start -->
<div class="righthead">
<div class="topsec">
<!-- Service Time and Search Start -->
<!-- Service Time and Search End -->
<!-- Top Navigation Start -->
<div class="menuwrapper">
<?php $redirectTo = (is_home() || is_front_page()) ? home_url() : $_SERVER['REQUEST_URI'];?>
<?php if( ! is_user_logged_in()): ?>
<ul class="topnavi" style="float:right;">
<li><?php _e('Member Login', 'heavens_corner');?>
<!-- Login Bubble Start -->
<div id="loginbox"> <span class="logintop"> </span>
<div class="logincenter">
<h3 class="white bold upper"><?php _e('User Login', 'heavens_corner');?></h3>
<form action="<?php bloginfo('url');?>/wp-login.php" method="post" name="loginform" id="loginform">
<ul>
<li><h5 class="white"><?php _e('User Name', 'heavens_corner');?></h5></li>
<li><input name="log" type="text" class="bar" /></li>
<li><h5 class="white"><?php _e('Password', 'heavens_corner');?></h5></li>
<li><input name="pwd" type="password" class="bar" /><input type="hidden" value="<?php echo $redirectTo;?>" name="redirect_to" /></li>
<li><?php _e('Forget Password?', 'heavens_corner');?> </li>
<li class="nopading"><input type="submit" value="<?php _e('Sign in Now', 'heavens_corner');?>" class="button backcolr" /></li>
</ul>
</form>
</div>
<span class="loginbottom"> </span> </div>
<!-- Login Bubble End -->
</li>
</ul>
<?php else:?>
<ul class="topnavi" style="float:right;">
<li><?php _e('Logout', 'heavens_corner');?>
</ul>
<?php endif;?>
<?php wp_nav_menu(array('theme_location'=>'top-menu', 'container'=>false, 'menu_class'=>'topnavi')); //Top menu?>
<br />
<?php wp_nav_menu(array('theme_location'=>'main-menu', 'container'=>false, 'menu_class'=>'subnavi')); //Top menu?>
</div>
<!-- Top Navigation End -->
</div>
<ul class="boxed">
<?php get_template_part('modules/top_links');?>
<!-- Search Start -->
<li class="last">
<?php echo get_search_form(); //Search form ?>
</li>
<!-- Search End -->
</ul>
<div class="clear"></div>
<?php if($header_settings = get_option(THEME_PREFIX.'general_settings')):?>
<!--Header Short Text-->
<div class="watchlive">
<h3><?php echo character_limiter(kvalue($header_settings, 'header_text'), 50);?></h3>
</div>
<?php endif;?>
</div>
<!-- Right Header End -->
</div>
</div>
<!-- Bread Crumb Start -->
<div class="breadcrumb" style="margin-top:24px;">
<?php echo get_the_breadcrumb(); ?>
</div>
<!-- Bread Crumb End -->
<!-- Sub Page Banner Start -->
<div class="subbanner">
<?php fw_top_banner('category'); //Get big header image?>
</div>
<!-- Sub Page Banner End -->
<!-- Column 3 Start -->
<div class="col3 border-right left">
<!-- Blog Start -->
<div class="blog">
<h1 class="heading colr"><?php single_cat_title();?></h1>
<!-- Blog Post Start -->
<div class="post noborder nopading">
<?php while ( have_posts() ) : the_post(); ?>
<div class="post-date backcolr">
<span><?php echo get_the_date('j');?></span>
<span><?php echo get_the_date('M');?></span>
</div>
<div class="post-heading">
<h5><?php the_title(); ?></h5>
</div>
<div class="clear"></div>
<?php if($media = fw_post_video('w=667&h=369&showThumb=1&thumbSize=category-featured')):?>
<div class="post-thumb">
<?php echo $media;?>
</div>
<?php endif;?>
<div class="post-feat">
<ul>
<li class="authore"><?php _e('by,', 'heavens_corner');?> <?php the_author();?></li>
<li class="comments"><?php comments_number();?></li>
<?php if(has_tag()):?><li class="tags"><?php the_tags();?></li><?php endif;?>
</ul>
</div>
<div class="clear"></div>
<div class="post-desc">
<p><?php echo (function_exists('the_exerpt')) ? get_the_exerpt() : character_limiter(get_the_content(),450,'',true);?></p>
<?php _e('Keep Reading', 'heavens_corner');?>
</div>
<?php endwhile; ?>
</div>
<!-- Blog Post End -->
<!-- Pagination Start -->
<?php if($wp_query->max_num_pages > 1):?>
<div class="paginations">
<ul><?php fw_blog_pagination(); ?></ul>
</div>
<?php endif;?>
<!-- Pagination End -->
</div>
<!-- Blog End -->
</div>
<!-- Column 3 End -->
<!-- Column 1 Start -->
<div class="col1 right">
<!-- Widget Start -->
<?php fw_dynamic_sidebars('category', get_query_var('cat'));?>
<!-- Widget End -->
</div>
<!-- Column 1 End -->
</div>
<!-- Content Section End -->
</div>
<div class="clear"></div>
<!-- Footer Start -->
<?php get_footer(); ?>
Related
<?php $section1 = get_field('section1'); ?>
<div class="section1" id="section1">
<div class="container">
<h2><?php echo $section1['title']; ?></h2>
<div class="quote-triangle">
<p>
<?php echo $section1['quote']; ?>
</p>
<div class="quote__moving-border"></div>
</div>
<div class="bottom">
<div data-aos="fade-down">
<div class="leftside">
<h3>
<?php echo $section1['title_image']; ?>
</h3>
<div class="caption"><?php echo $section1['caption_image']; ?></div>
<div class="desc">
<p>
<?php echo $section1['desc_image']; ?>
</p>
</div>
</div>
</div>
<div data-aos="fade-down">
<div class="rightside">
<img src="<?php echo esc_url( $secttion1['image']['url'] ); ?>" alt="" class="rightside__img">
</div>
</div>
</div>
</div>
</div>
<?php endif; ?>
I had followed literally the ACF documentation for the GROUP type but when I put the if in the PHP tag the whole section disappears and when I remove if the section back but The Group type still not worked.
I'm building a WordPress website. Everything went fine before using custom post types. When I use CPT and write PHP code then a section can't print the custom fields. This affects only one section. Other sections and custom fields works fine.
Before adding this code the custom field worked fine:
<?php
$args = array("post_type" => "project_feature");
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post(); ?>
<div class="col-sm-4">
<?php
if(has_post_thumbnail())
{
the_post_thumbnail();
}
?>
<h3><?php the_title(); ?></h3>
<div class="black_text"><?php the_content(); ?></div>
</div> <!-- col -->
<?php endwhile; wp_reset_query(); ?>
But now if I delete this code my custom feature still doesn't work. I don't understand what I am doing wrong. I still don't know if it's my code or something else in WordPress.
This custom fields within the instructor section aren't working:
<?php
// instructor custom fields
$instructor_name = get_field('instructor_name');
$instructor_description = get_field('instructor_description');
$students = get_field('students');
$views = get_field('views');
$courses = get_field('courses');
?>
<!-- INSTRUCTOR
=========================================
-->
<section id="instructor">
<div class="container">
<div class="row">
<div class="col-sm-6">
<div class="row">
<div class="col-sm-8">
<h3>Your Instructor <small><?php echo $instructor_name; ?></small></h3>
</div> <!-- col -->
<div class="col-sm-4">
<ul>
<li>
<i class="fa fa-facebook social" aria-hidden="true"></i>
</li>
<li>
<i class="fa fa-google-plus social" aria-hidden="true"></i>
</li>
<li>
<i class="fa fa-linkedin social" aria-hidden="true"></i>
</li>
</ul>
</div> <!-- col -->
</div> <!-- row -->
<div class="row">
<div class="col-sm-12">
<p class="black_text"><?php echo $instructor_description; ?></p>
<hr>
</div> <!-- col -->
</div> <!-- row -->
<div class="row">
<div class="col-sm-12">
<h3>The numbers <small>They don't lie...</small></h3>
</div> <!-- col -->
<div class="col-sm-4 round_display">
<p class="black_text"><?php echo $students; ?> students</p>
</div> <!-- col -->
<div class="col-sm-4 round_display">
<p class="black_text"><?php echo $views; ?> views</p>
</div> <!-- col -->
<div class="col-sm-4 round_display">
<p class="black_text"><?php echo $courses; ?> courses</p>
</div> <!-- col -->
</div> <!-- row -->
</div> <!-- col -->
<div class="col-sm-6">
<img src="<?php bloginfo('stylesheet_directory'); ?>/image/brad.png" alt="man" class="img-responsive center-block income_image"/>
</div> <!-- col -->
</div> <!-- row -->
</div> <!-- container -->
</section> <!-- INSTRUCTOR -->
I have something that I just can't understand. I did a one page layout site in wordpress. It consist of one template-index.php that only have one mainContainer div and about 6 include_once template-. Then in the admin section of wordpress I used advanced custom fields to create the different fields all related to template-index.php.
Everything shows up just fine except for the text on the last frame or last include if you will. But here is the strange thing. If I change the order of the last two includes both text shows up just fine and then when I change the order back the last include loose it's text again.
I checked the code, every php tag is closed just fine, the include before also. I don't know. Did something like this ever happen to one of you? What could it be?
Thanks
edit:
here is a bit of code.
So the index page is pretty simple:
<?php
/* Template Name: index template */
?>
<?php get_header(); ?>
<div class="mainContainer"id='fullpage'>
<?php include_once 'template-about.php'; ?>
<?php include_once 'template-theDesign.php'; ?>
<?php include_once 'template-theApp.php'; ?>
<?php include_once 'template-getApp.php'; ?>
<?php include_once 'template-community.php'; ?>
<?php include_once 'template-contact.php'; ?>
</div>
<?php get_footer(); ?>enter code here
the last two includes look like this:
<?php
/* Template Name: Bob community template */
?>
<!-- <div id="section-5"> -->
<div class="sectionContainer community section" id='section_five'>
<div class="container main">
<div class="vertical100 firstSection col-md-12 topSection ">
<section class='worldMap animation col-md-6'>
<div class="imgContainer">
<div class="wordpressImg">
<img class='worldMap' src="<?php echo get_template_directory_uri(); ?>/img/worldmap.png" />
</div> <!-- wordpressImg -->
</div><!-- imgContainer -->
</section>
<section class="explications col-md-6">
<div class="communityExplication">
<div class="wordpressTexte">
<?php the_field('community_text'); ?>
<div class="stories">
<?php
$args = array( 'post_type' => 'stories', 'posts_per_page' => 8, 'orderby' => 'rand' );
$loop = new WP_Query($args);
$posts = $loop->posts;
if(have_posts()) {
$first = true; ?>
<div class="storieAligner">
<div class="stories-container ">
<?php
$count = 0;
while($loop->have_posts() ) : $loop->the_post();
$randomPost = $posts[$count];
$image = get_field('images');
$temoignage = get_field('temoignage');
?>
<!-- <div class="storiePhoto"> -->
<div class='storiesThumbs' style='background-image: url("<?php echo $image['url']; ?>")' data-temoignage="<?php echo $temoignage; ?>"></div>
<div class="categorie"></div>
<!-- </div> -->
<?php $count++; endwhile; ?>
</div> <!-- stories-container -->
<div class="fullStorie hiddenStorie">
<div class="back"></div>
<div class="leftDiv">
<div class="leftContent">
</div>
</div>
<div class="rightDiv">
<div class="rightContent"></div>
</div>
</div>
</div> <!-- storieAligner -->
<?php }; ?> <!-- if have_posts -->
</div> <!-- stories -->
<div class="linkContainer" ><a class='formToggle pinkButton roll' href="#" title="Wha you say"><span data-title='What you say'>What you say</span></a></div>
</div> <!-- wordpressTexte -->
</div> <!-- commnunityExplication -->
<!-- <div class="storiesFormContainer"> -->
<div class="storiesForm hidden">
<div class="formContainer">
<h1><?php echo __('Leave a Review of your app ', 'site'); ?></h1>
<?php echo do_shortcode('[contact-form-7 id="89" title="community-contact"]'); ?>
</div>
</div>
<!-- </div> storiesFormContainer -->
</section>
</div> <!-- get app -->
</div> <!-- main -->
and the contact template like this
<?php
/* Template Name: Contact-us template */
?>
<!-- section-6 -->
<div class="sectionContainer contact section" id='section_six'>
<div class="container main" >
<div class="vertical100 col-md-12 topSection ">
<section class='explications col-md-3'>
<div class="blockTexte">
<div class="wordpressTexte">
<?php the_field('questions'); ?>
<a class ='pinkButton roll' href="#" title="visit page"><span data-title='<?php echo __('visit page', 'site'); ?>'><?php echo __('visit page', 'site'); ?></span></a>
</div>
</div>
</section>
<section class="formulaire col-md-9">
<div class="formContainer">
<div class="wordpressForm">
<?php echo do_shortcode('[contact-form-7 id="44" title="contact-us"]'); ?>
</div>
</div>
</section>
</div> <!-- knowBob -->
</div>
So what could be wrong?
P.s. I know there's a bit a french and english in the code. I usually write what comes up first in my head.
You need to reset the post data to the original query using wp_reset_postdata after you're done looping through a custom query:
<div class="stories-container ">
<?php
$count = 0;
while($loop->have_posts() ) : $loop->the_post();
$randomPost = $posts[$count];
$image = get_field('images');
$temoignage = get_field('temoignage');
?>
<!-- <div class="storiePhoto"> -->
<div class='storiesThumbs' style='background-image: url("<?php echo $image['url']; ?>")' data-temoignage="<?php echo $temoignage; ?>"></div>
<div class="categorie"></div>
<!-- </div> -->
<?php $count++; endwhile; wp_reset_postdata(); ?><!-- this line here -->
</div> <!-- stories-container -->
Otherwise the $post object will remain the last post of the $loop query, causing any other behind the scenes requests for post data down the road (in your case get_field) to reference the wrong post until you hit the outer loop again.
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
Am getting unexpected end of file error on line 340 or so. I just can't figure out the solution. Someone please help. I tried Cheking some solutions online. Mostly I was told to space php tags from brackets, I tried that but still
<?php
/*!
* Theme Name: xx
* Theme URI: http://www.example.com
* Version: 1.0
* Description:
* Author: JM Team - example.com
* Author URI: http://www.example.com
*
* Powered by Magento
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
*/
$baseconfig = Mage::helper("jmtheme")->getactiveprofile();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->getLang() ?>" lang="<?php echo $this->getLang() ?>">
<!--[if IE]>
<html class="ie" xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->getLang() ?>" lang="<?php echo $this->getLang() ?>">
<![endif]-->
<!--[if IE 8]>
<html class="ie8" xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->getLang() ?>" lang="<?php echo $this->getLang() ?>">
<![endif]-->
<!--[if IE 9]>
<html class="ie9" xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->getLang() ?>" lang="<?php echo $this->getLang() ?>">
<![endif]-->
<!--[if IE 10]>
<html class="ie10" xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->getLang() ?>" lang="<?php echo $this->getLang() ?>">
<![endif]-->
<head>
<?php echo $this->getChildHtml('head') ?>
</head>
<body id="bd" class="<?php echo $this->getBodyClass();?> <?php echo 'skin-'.Mage::helper("jmbasetheme")->getprofile(); ?>">
<?php echo $this->getChildHtml('after_body_start') ?>
<div id="jm-wrapper">
<!-- BEGIN: HEADER -->
<div id="jm-header" class="wrap clearfix">
<?php echo $this->getChildHtml('header') ?>
</div>
<!-- END: HEADER -->
<?php if($baseconfig["urlfacebook"] || $baseconfig["urltwitter"] || $baseconfig["urlgoogleplus"] || $baseconfig["urlpinterest"] || $baseconfig["urltumblr"] || $baseconfig["urlskype"]): ?>
<div class="sidebar-socials">
<?php if($baseconfig["urlfacebook"]): ?>
<?php endif; ?>
<?php if($baseconfig["urltwitter"]): ?>
<?php endif; ?>
<?php if($baseconfig["urlgoogleplus"]): ?>
<?php endif; ?>
<?php if($baseconfig["urlpinterest"]): ?>
<?php endif; ?>
<?php if($baseconfig["urltumblr"]): ?>
<?php endif; ?>
<?php if($baseconfig["urlskype"]): ?>
<?php endif; ?>
</div>
<!-- BEGIN: toolbar -->
<div id="jm-head" class="wrap clearfix">
<?php echo $this->getChildHtml('jmtoolbar') ?>
</div>
<!-- END: toolbar -->
<?php if ($this->getChildHtml('tops1')) : ?>
<!-- TOP SPOTLIGHT -->
<div id="jm-tops1" class="jm-position wrap clearfix">
<div class="main col1-set">
<div class="inner clearfix">
<?php echo $this->getChildHtml('tops1') ?>
</div>
</div>
</div>
<!-- //TOP SPOTLIGHT -->
<?php endif; ?>
<?php if ($this->getChildHtml('tops2')) : ?>
<!-- //TOP SPOTLIGHT 2 -->
<div id="jm-tops2" class="jm-position wrap clearfix">
<div class="main col3-set">
<div class="inner clearfix">
<?php echo $this->getChildHtml('tops2') ?>
</div>
</div>
</div>
<!-- //TOP SPOTLIGHT 2 -->
<?php endif; ?>
<?php if ($this->getChildHtml('tops3')) : ?>
<!-- //TOP SPOTLIGHT 3 -->
<div id="jm-tops3" class="jm-position wrap clearfix">
<div class="main col1-set">
<div class="inner">
<?php echo $this->getChildHtml('tops3') ?>
</div>
</div>
</div>
<!-- //TOP SPOTLIGHT 3 -->
<?php endif; ?>
<?php if ($this->getChildHtml('tops4')) : ?>
<!-- //TOP SPOTLIGHT 4 -->
<div id="jm-tops4" class="jm-position wrap clearfix">
<div class="main col1-set">
<div class="inner">
<?php echo $this->getChildHtml('tops4') ?>
</div>
</div>
</div>
<!-- //TOP SPOTLIGHT 4 -->
<?php endif; ?>
<?php if ($this->getChildHtml('tops5')) : ?>
<!-- //TOP SPOTLIGHT 5 -->
<div id="jm-tops5" class="jm-position wrap clearfix">
<div class="main col1-set">
<div class="inner">
<?php echo $this->getChildHtml('tops5') ?>
</div>
</div>
</div>
<!-- //TOP SPOTLIGHT 5 -->
<?php endif; ?>
<?php if ($this->getChildHtml('tops6')) : ?>
<!-- //TOP SPOTLIGHT 6 -->
<div id="jm-tops6" class="jm-position wrap clearfix">
<div class="main col1-set">
<div class="inner">
<?php echo $this->getChildHtml('tops6') ?>
</div>
</div>
</div>
<!-- //TOP SPOTLIGHT 6 -->
<?php endif; ?>
<?php if ($this->getChildHtml('tops7')) : ?>
<!-- //TOP SPOTLIGHT 7 -->
<div id="jm-tops7" class="jm-position wrap clearfix">
<div class="main col1-set">
<div class="inner">
<?php echo $this->getChildHtml('tops7') ?>
</div>
</div>
</div>
<!-- //TOP SPOTLIGHT 7 -->
<?php endif; ?>
<?php if ($this->getChildHtml('tops8')) : ?>
<!-- //TOP SPOTLIGHT 8 -->
<div id="jm-tops8" class="jm-position wrap clearfix">
<div class="main col1-set">
<div class="inner">
<?php echo $this->getChildHtml('tops8') ?>
</div>
</div>
</div>
<!-- //TOP SPOTLIGHT 8 -->
<?php endif; ?>
<?php if ($this->getChildHtml('tops9')) : ?>
<!-- //TOP SPOTLIGHT 9 -->
<div id="jm-tops9" class="jm-position wrap clearfix">
<div class="main col1-set">
<div class="inner">
<?php echo $this->getChildHtml('tops9') ?>
</div>
</div>
</div>
<!-- //TOP SPOTLIGHT 9 -->
<?php endif; ?>
<?php if ($this->getChildHtml('tops10')) : ?>
<!-- //TOP SPOTLIGHT 10 -->
<div id="jm-tops10" class="jm-position wrap clearfix">
<div class="main col1-set">
<div class="inner">
<?php echo $this->getChildHtml('tops10') ?>
</div>
</div>
</div>
<!-- //TOP SPOTLIGHT 10 -->
<?php endif; ?>
<?php if ($this->getChildHtml('tops11')) : ?>
<!-- //TOP SPOTLIGHT 11 -->
<div id="jm-tops11" class="jm-position wrap clearfix">
<div class="main col1-set">
<div class="inner">
<?php echo $this->getChildHtml('tops11') ?>
</div>
</div>
</div>
<!-- //TOP SPOTLIGHT 11 -->
<?php endif; ?>
<?php if ($this->getChildHtml('tops12')) : ?>
<!-- //TOP SPOTLIGHT 12 -->
<div id="jm-tops12" class="jm-position wrap clearfix">
<div class="main col1-set">
<div class="inner">
<?php echo $this->getChildHtml('tops12') ?>
</div>
</div>
</div>
<!-- //TOP SPOTLIGHT 12 -->
<?php endif; ?>
<?php if ($this->getChildHtml('mass-top')) : ?>
<!-- //TOP MASS -->
<div id="jm-mass-top" class="jm-mass-top wrap clearfix">
<div class="main col1-set">
<div class="inner clearfix">
<?php echo $this->getChildHtml('mass-top') ?>
</div>
</div>
</div>
<!-- //TOP MASS -->
<?php endif; ?>
<?php if ($this->getChildHtml('breadcrumbs')) : ?>
<!-- breadcrums -->
<div id="jm-breadcrumbs" class="wrap clearfix">
<div class="main clearfix">
<div class="inner clearfix">
<?php echo $this->getChildHtml('breadcrumbs') ?>
</div>
</div>
</div>
<!-- // breadcrums -->
<?php endif; ?>
<?php if($this->getChildHtml('global_messages') || $this->getChildHtml('messages')) :?>
<div id="jm-messages" class="wrap clearfix">
<div class="main clearfix">
<div class="inner clearfix">
<?php echo $this->getChildHtml('global_messages') ?>
<?php echo $this->getChildHtml('messages') ?>
</div>
</div>
</div>
<?php endif; ?>
<!-- BEGIN: MAIN CONTAINER -->
<div id="jm-container" class="jm-col2-left-layout <?php if(!$this->getChildHtml('breadcrumbs')) { echo "not-breadcrumbs"; } ?> wrap clearfix">
<div class="main clearfix">
<div id="jm-mainbody" class="clearfix">
<!-- BEGIN: CONTENT -->
<div id="jm-main">
<div class="inner clearfix">
<div id="jm-current-content" class="clearfix">
<!-- //TOP SPOTLIGHT 3 -->
<?php if ($this->getChildHtml('mass-top')) : ?>
<div id="jm-mass-top" class="jm-mass-top clearfix">
<div class="col1-set">
<?php echo $this->getChildHtml('mass-top') ?>
</div>
</div>
<?php endif; ?>
<!-- //TOP SPOTLIGHT 3 -->
<!-- MASS Head -->
<?php if ($this->getChildHtml('mass-head')) : ?>
<div id="jm-mass-head" class="jm-mass-head">
<?php echo $this->getChildHtml('mass-head') ?>
</div>
<?php endif; ?>
<!-- primary content -->
<?php echo $this->getChildHtml('content') ?>
<!-- // primary content -->
</div>
</div>
</div>
<!-- END: CONTENT -->
<!-- BEGIN: COLUMN 1 -->
<div id="jm-col1" class="col-left sidebar">
<div class="inner clearfix">
<?php echo $this->getChildHtml('left') ?>
</div>
</div>
<!-- END: COLUMN 1 -->
</div>
</div>
</div>
<!-- END: MAIN CONTAINER -->
<?php if ($this->getChildHtml('mass-bottom')) : ?>
<!-- //BOTTOM SPOTLIGHT -->
<div id="jm-mass-bottom" class="jm-mass-bottom wrap clearfix">
<div class="main col3-set">
<?php echo $this->getChildHtml('mass-bottom') ?>
</div>
</div>
<!-- //BOTTOM SPOTLIGHT -->
<?php endif; ?>
<?php if ($this->getChildHtml('bots1')) : ?>
<!-- BOTTOM SPOTLIGHT -->
<div id="jm-bots1" class="wrap clearfix">
<div class="main col2-set clearfix">
<div class="inner clearfix">
<?php echo $this->getChildHtml('bots1') ?>
</div>
</div>
</div>
<!-- //BOTTOM SPOTLIGHT -->
<?php endif; ?>
<?php if ($this->getChildHtml('bots2')) : ?>
<!-- BOTTOM SPOTLIGHT -->
<div id="jm-bots2" class="wrap clearfix">
<div class="main col1-set clearfix">
<?php echo $this->getChildHtml('bots2') ?>
</div>
</div>
<!-- //BOTTOM SPOTLIGHT -->
<?php endif; ?>
<?php if ($this->getChildHtml('bots3')) : ?>
<!-- BOTTOM SPOTLIGHT -->
<div id="jm-bots3" class="wrap clearfix">
<div class="main col1-set clearfix">
<div class="inner clearfix">
<?php echo $this->getChildHtml('bots3') ?>
</div>
</div>
</div>
<!-- //BOTTOM SPOTLIGHT -->
<?php endif; ?>
<!-- BEGIN: FOOTER -->
<div id="jm-footer" class="wrap clearfix">
<div class="main">
<div class="inner clearfix">
<div class="inner2 clearfix">
<?php echo $this->getChildHtml('footer') ?>
</div>
</div>
</div>
</div>
<!-- END: FOOTER -->
<?php echo $this->getChildHtml('before_body_end') ?>
</div>
<?php echo $this->getAbsoluteFooter() ?>
</body>
</html>
Posting my comment to an answer:
You don't have an endif for both <?php if($baseconfig["urlfacebook"] ||...
and <?php echo $this->getChildHtml('left') ?>
You have 29 if conditions and 27 endif's
Your problem is that you forgot to close an if condition so it should look like this:
<?php if($baseconfig["urlfacebook"] || $baseconfig["urltwitter"] || $baseconfig["urlgoogleplus"] || $baseconfig["urlpinterest"] || $baseconfig["urltumblr"] || $baseconfig["urlskype"]): ?>
<div class="sidebar-socials">
<?php if($baseconfig["urlfacebook"]): ?>
<?php endif; ?>
<?php if($baseconfig["urltwitter"]): ?>
<?php endif; ?>
<?php if($baseconfig["urlgoogleplus"]): ?>
<?php endif; ?>
<?php if($baseconfig["urlpinterest"]): ?>
<?php endif; ?>
<?php if($baseconfig["urltumblr"]): ?>
<?php endif; ?>
<?php if($baseconfig["urlskype"]): ?>
<?php endif; ?>
<?php endif; ?>
I made a single page HTML to WordPress website. There are 4 sections and 4 menu items. The section id and menu id are the same (ordering by page order).
Basically in the HTML format when you click on the menu, the scroll bar automatically goes to the related section. When I turn it into WordPress everything is working but when I click over the menu it doesn't.
<!-- Menu section -->
<div class="col-md-8 col-sm-10 col-xs-4 main-menu text-right">
<ul class="menu-first hidden-sm hidden-xs">
<?php
global $post;
$args = array('post_type'=>'page','orderby'=>'menu_order','order'=>'ASC');
$myposts = get_posts($args);
foreach($myposts as $post) : setup_postdata($post);?>
<li><?php the_title(); ?></li>
<?php endforeach; ?>
</ul>
<i class="fa fa-bars"></i>
</div> <!-- /.main-menu -->
<!-- Service -->
<div class="content-section" id="<?php echo $post->post_name; ?>">
<div class="container">
<div class="row">
<div class="heading-section col-md-12 text-center">
<h2>Services</h2>
</div> <!-- /.heading-section -->
</div> <!-- /.row -->
<div class="row">
<?php
global $post;
$args = array('post_type'=>'service','orderby'=>'menu_order','order'=>'ASC');
$myposts = get_posts($args);
foreach($myposts as $post) : setup_postdata($post); ?>
<div class="col-md-3 col-sm-6">
<div class="service-item" id="service-1">
<div class="service-icon">
<i class="fa fa-<?php echo $service_icon; ?>"></i>
</div> <!-- /.service-icon -->
<div class="service-content">
<div class="inner-service">
<h3><?php the_title(); ?></h3>
<?php the_content(); ?>
</div>
</div> <!-- /.service-content -->
</div> <!-- /#service-1 -->
</div> <!-- /.col-md-3 -->
<?php endforeach; ?>
</div> <!-- /.row -->
</div> <!-- /.container -->
</div> <!-- /#services -->
Related code located also at paste bin.
I don't see any anchors with name attributes for your link to actually jump to. Try this:
<?php foreach($myposts as $post) : setup_postdata($post); ?>
<div class="col-md-3 col-sm-6">
<div class="service-item" id="service-1">
<!-- Rest of markup removed for clarity -->
<h3>
<a name="<?php echo $post->post_name; ?>"><?php the_title(); ?></a>
</h3>
</div>
</div>
<?php endforeach; ?>