Support » Fixing WordPress » c2c_get_custom to change layout?

  • Resolved Rokuzen


    I’m trying to get the get_custom plugin to trigger a change in layout (adding a right column) when the key “rightside” is entered (the value to be shown in said column).

    Rightnow here is how i have it

    if (c2c_get_custom('rightside')) {
    echo "<div id="contentColumnContainer">";
    else {
    echo "<div id="contentColumnContainer2">";

    Contentcolumncontainer providing the space for the right columm, contentColumnContainer2 allowing the content area to span.

    Obviously its not working and obviously I’m still new to php. what do I need to addto get the if statement to trigger when there’s rightside as a key?

    Note, the content of the value field does show up (albeit off the screen).

    Thats being called by
    if (c2c_get_custom('rightside')) {
    echo "<div id=\"rightColumn\"><div class=\"inside\">";
    foreach ($posts as $post) : start_wp();
    echo c2c_get_custom('rightside');
    echo "</div><hr class=\"hide\">
    else {

    for an example of whats (not) going on has ‘rightside’ does not and should span the content area (i have it set up so theres always space for the right column, till this is fixed)

    Hope i explained it ok

    thanks in advance,

Viewing 2 replies - 1 through 2 (of 2 total)
  • <?php if ( (c2c_get_custom('rightside')) ) { ?>
    <div id="contentColumnContainer">
    <?php } else { ?>
    <div id="contentColumnContainer2">
    <?php } ?>

    That should work. Basically what it’s saying is that if the Key ‘rightside’ exists (regardless of it’s value) then do div 1, if it doesn’t exist, do div 2.

    Note, this has to be executed inside the loop (from memory), but if that’s going to be a problem I can find a few work arounds.

    Post back if it doesn’t work.

    Holy cats! Your solution worked. I added it into another loop and bingo.


Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘c2c_get_custom to change layout?’ is closed to new replies.