mercredi 23 août 2017

Adding three PHP if queries into one page with HTML

I have three

<?php if( array_key_exists( 'overview', $wp_query->query_vars ) ){
;}?>

In one single-post.php template

<?php if( array_key_exists( 'overview', $wp_query->query_vars ) ){
;}?>

<?php if( array_key_exists( 'analytics', $wp_query->query_vars ) ){
;}?>

<?php if( array_key_exists( 'edit', $wp_query->query_vars ) ){
;}?>

I need them contain variations of the below

<div class="content ">
    <div class="container-fluid bg-transparent m-t-50 container-fixed-lg">
        <div class="row">
            <div class="col-md-6">
                <button onclick="location.href='/campaigns'" class="btn btn-default btn-xs  btn-rounded m-r-20"><i class="fa fa-angle-left" style="color:#828ba4"></i>  <span class="back-campaign">Back to campaigns</span></button>
                <h1>
                    <?php the_title(); ?>   
                </h1>
            </div>
            <div class="col-md-6 hidden-md-up">
                <div class="pull-left">
                    <a href="<?php echo esc_url( get_permalink() ); ?>/analytics">
                    <button class="m-t-10 m-b-10 btn btn-grey btn-cons"  type="button">
                    View Analytics
                    </button>
                    </a>
                    <a href="<?php echo esc_url( get_permalink() ); ?>/edit-campaign">
                    <button class="m-t-10 m-b-10 btn btn-primary btn-cons"  type="button">
                    Edit Campaign
                    </button>
                    </a>
                </div>
            </div>
        </div>
    </div>

Is there a way to do this without echo?

Aucun commentaire:

Enregistrer un commentaire