• hi,

    I want different sidebar(right). For now I am using this way:

    <?php
    if($url_check==’contact’)
    {
    CONTACT FORM
    }
    else if($url_check==’about_us’)
    {
    TESTIMONIALS
    }
    ?>

    This way Conditions I am using are STATIC like contact,about_us.
    Now what If admin changes contact to contact-us.

    So, I want Dynamic Solution(condition).

    Please help me…

    Thanks
    Cristopher.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi, cristopher_elsner!!!
    Try this scenario, get the permalink and try to explode it, and pass its last array index which is your page name.

    Example:

    <?php
      $permalink = get_permalink( );
          $c = explode('/', $permalink);
    	echo "<pre>";
    	  print_r($c);
    	echo "</pre>";
    	$a = $c[4];
    	echo $a;
    ?>

    OutPut:

    https://localhost/wp-quickstart/testpage
    Array
    (
        [0] => http:
        [1] =>
        [2] => localhost
        [3] => wp-quickstart
        [4] => testpage
    )
    testpage

    Thread Starter cristopher_elsner

    (@cristopher_elsner)

    hi mr49online,

    Thank you for your help.

    @cristopher_elsner: you welcome ………. :),
    hope you got the solution of your issue, isn’t it?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘best theming way’ is closed to new replies.