Hi i am trying to get the custom post category name within my loop , i have two catagory , How can i use this html attribute inside my php tag can someone help me on this . if cat consol is get selected this need to show some custome post contnet, if that not need to select the second item.
<section id="startups">
<div class="container container-fullWidth">
<div class="sectionContent">
<?php
$loop=new WP_Query(array('post_type'=>'startup',
'sort_column' => 'post_date',
'posts_per_page'=> -1
//'order' => 'DESC'
)
);
if ( $loop->have_posts() )
{
while ( $loop->have_posts() )
{
$loop->the_post();
?>
<h2 class="sectionHeader"> <p class ="post_title">STARTUPS</p><span class="borderBottom"></span></h2>
<div class="row startupSec">
<div class="col-lg-12" id="start">
<!-- <div class="ls-nav-left-arrow"><a href="#"></a></div> -->
<!----startup button---->
<div class="row">
<section class="color-1">
<div class="cl-effect-20">
<?php
$cat=get_post_meta($post->ID,'category',true);
if ($cat=='console')
{
echo "<div class="startupbutton col-lg-offset-4 col-lg-2 col-md-offset-3 col-md-3 col-sm-offset-2 col-sm-4 ">
<a><span class="orangeBtn" id="lilleSliderBtn" data-hover="LILLE">LILLE</span></a>
<span class="radtypecircle" id="lilleRadio"></span>";?>
<?php echo"div" ?>
}
else if ($cat=='consol2')
{
<?php
echo "<div class="startupbutton col-lg-2 col-md-3 col-sm-4">
<a><span class="orangeBtn" id="parisSliderBtn" data-hover="PARIS">PARIS</span></a>";?>
<?php echo"</div>" ?>
<?php
}
?>
Aucun commentaire:
Enregistrer un commentaire