Skip to main content
update formatting
Source Link

I have the following code, which displays the content for my custom page template ""landingpagelandingpage.php"php" and for single posts. The site uses Bootstrap 4.

<?php if(is_page_template( 'landingpage.php' )): ?>

    <div id="content" class="site-content">
        <div class="container-fluid">
            <div class="row">

        <?php elseif (is_single()): ?>

    <div id="content" class="site-content pt-4">
        <div class="container-fluid">
            <div class="row">

        <?php else: ?>

    <div id="content" class="site-content">
        <div class="container">
            <div class="row">
<?php endif; ?>

Is there a more elegant and/or shorter way to achieve this?

I have the following code, which displays the content for my custom page template "landingpage.php" and for single posts. The site uses Bootstrap 4.

<?php if(is_page_template( 'landingpage.php' )): ?>

    <div id="content" class="site-content">
        <div class="container-fluid">
            <div class="row">

        <?php elseif (is_single()): ?>

    <div id="content" class="site-content pt-4">
        <div class="container-fluid">
            <div class="row">

        <?php else: ?>

    <div id="content" class="site-content">
        <div class="container">
            <div class="row">
<?php endif; ?>

Is there a more elegant and/or shorter way to achieve this?

I have the following code, which displays the content for my custom page template "landingpage.php" and for single posts. The site uses Bootstrap 4.

<?php if(is_page_template( 'landingpage.php' )): ?>

    <div id="content" class="site-content">
        <div class="container-fluid">
            <div class="row">

        <?php elseif (is_single()): ?>

    <div id="content" class="site-content pt-4">
        <div class="container-fluid">
            <div class="row">

        <?php else: ?>

    <div id="content" class="site-content">
        <div class="container">
            <div class="row">
<?php endif; ?>

Is there a more elegant and/or shorter way to achieve this?

Update wording
Source Link

I have the following code, which displays the content for my custom page template "landingpage.php" and for single posts. The site is based onuses Bootstrap 4.

<?php if(is_page_template( 'landingpage.php' )): ?>

    <div id="content" class="site-content">
        <div class="container-fluid">
            <div class="row">

        <?php elseif (is_single()): ?>

    <div id="content" class="site-content pt-4">
        <div class="container-fluid">
            <div class="row">

        <?php else: ?>

    <div id="content" class="site-content">
        <div class="container">
            <div class="row">
<?php endif; ?>

Is there a more elegant and/or shorter way to achieve this?

I have the following code, which displays the content for my custom page template "landingpage.php" and for single posts. The site is based on Bootstrap 4.

<?php if(is_page_template( 'landingpage.php' )): ?>

    <div id="content" class="site-content">
        <div class="container-fluid">
            <div class="row">

        <?php elseif (is_single()): ?>

    <div id="content" class="site-content pt-4">
        <div class="container-fluid">
            <div class="row">

        <?php else: ?>

    <div id="content" class="site-content">
        <div class="container">
            <div class="row">
<?php endif; ?>

Is there a more elegant and/or shorter way to achieve this?

I have the following code, which displays the content for my custom page template "landingpage.php" and for single posts. The site uses Bootstrap 4.

<?php if(is_page_template( 'landingpage.php' )): ?>

    <div id="content" class="site-content">
        <div class="container-fluid">
            <div class="row">

        <?php elseif (is_single()): ?>

    <div id="content" class="site-content pt-4">
        <div class="container-fluid">
            <div class="row">

        <?php else: ?>

    <div id="content" class="site-content">
        <div class="container">
            <div class="row">
<?php endif; ?>

Is there a more elegant and/or shorter way to achieve this?

added 5 characters in body
Source Link

I have the following code, which displays the content for my custom page template "landingpage.php" and for single posts. The site is based on Bootstrap 4.

<?php if(is_page_template( 'landingpage.php' )): ?>

    <div id="content" class="site-content">
        <div class="container-fluid">
            <div class="row">

        <?php elseif (is_single()): ?>

    <div id="content" class="site-content pt-4">
        <div class="container-fluid">
            <div class="row">

        <?php else: ?>

    <div id="content" class="site-content">
        <div class="container">
            <div class="row">
<?php endif; ?>

Is there a more elegant and/or shorter way to doachieve this?

I have the following code, which displays the content for my custom page template "landingpage.php" and for single posts. The site is based on Bootstrap 4.

<?php if(is_page_template( 'landingpage.php' )): ?>

    <div id="content" class="site-content">
        <div class="container-fluid">
            <div class="row">

        <?php elseif (is_single()): ?>

    <div id="content" class="site-content pt-4">
        <div class="container-fluid">
            <div class="row">

        <?php else: ?>

    <div id="content" class="site-content">
        <div class="container">
            <div class="row">
<?php endif; ?>

Is there a more elegant and/or shorter way to do this?

I have the following code, which displays the content for my custom page template "landingpage.php" and for single posts. The site is based on Bootstrap 4.

<?php if(is_page_template( 'landingpage.php' )): ?>

    <div id="content" class="site-content">
        <div class="container-fluid">
            <div class="row">

        <?php elseif (is_single()): ?>

    <div id="content" class="site-content pt-4">
        <div class="container-fluid">
            <div class="row">

        <?php else: ?>

    <div id="content" class="site-content">
        <div class="container">
            <div class="row">
<?php endif; ?>

Is there a more elegant and/or shorter way to achieve this?

Tweeted twitter.com/StackCodeReview/status/1353764604950818817
deleted 1 character in body
Source Link
Loading
update wording
Source Link
Loading
update wording
Source Link
Loading
update formatting
Source Link
Loading
update wording
Source Link
Loading
edited tags
Link
Loading
Source Link
Loading