Divi WordPress Theme
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix Reply To: Multiple layout for posts

Discussion in 'Misc WordPress Requests' started by Peter Hardy-vanDoorn, Jan 12, 2018.

  1. Peter Hardy-vanDoorn


    Reply To: Multiple layout for posts, by Peter Hardy-vanDoorn

    That’s the beauty of CSS… the same HTML can be displayed in different ways.

    For example, a box can be floated right for normal view, or floated left for another, eg:

    .myclass { float: right; }
    body.concise .myclass { float: left; }

    Doing it that way would keep your development to a minimum as you’d only need one set of code.

    But, if you wanted to, the query string can still be used, eg:

    $myview = $_GET['myview'];
    if ( $myview != "concise" ) {
    // code to display normal view
    } else {
    // code to display concise view

    Oh, BTW, when I said originally “at the top of your single-customtype.php” I meant “at the top of header.php“!


    Reply To: Multiple layout for posts

Share This Page

Monarch Social Sharing Plugin