Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter kflogerzi

    (@kflogerzi)

    Awesome! Thanks so much for all your help! I wouldn’t have ever guessed such a simple problem could get so complicated, though thats probably mostly my fault! Thank you!

    Thread Starter kflogerzi

    (@kflogerzi)

    Ok great…. I had to modify that just slightly for it to work, so now it looks like:

    <?php if (!is_front_page() ) { ?>
    <div id="minipost_back"> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?> </div>
      <?php endif; ?>
    <?php } ?>

    However here’s the problem – its doing the opposite of what I want it to do. Its showing that dynamic sidebar on ALL the internal pages and NOT the homepage. But I want it to ONLY show on the homepage and NOT the internal pages.

    Any ideas?

    Thanks

    Thread Starter kflogerzi

    (@kflogerzi)

    And one more thing I tried was using the actual page, i.e.:
    if (is_page('17')
    Didn’t work either.

    Thread Starter kflogerzi

    (@kflogerzi)

    I also just tried this and it didn’t make a difference. Same problem.

    <div id="minipost_back">
     <?php
     wp_reset_query();
    
     if (!is_front_page() ) {
     	 if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) :
       endif;
     endif; ?>
    </div>

    And I tried removing the “!” in “if (!is_front_page()” – that didn’t make a difference either.

    Thread Starter kflogerzi

    (@kflogerzi)

    Ah that totally looks like it should be the answer, but when I put that in, everything below the header disappeared. Somehow it was breaking the flow of things. I tried a couple minor tweaks to it, but none of these worked either.

    <div id="minipost_back">
     <?php if (!is_front_page() ) {
      	 if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) :
       endif;
     endif;
     ?>
    </div>

    I also tried that with a “;” at the end of line 3 just in case…

    <?php if (!is_front_page() ) { ?>
    <div id="minipost_back"> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?> </div>
      <?php endif; ?>
    <?php endif; ?>

    So ya… any idea why that would break the rest of the code?
    Thanks so much btw for all your help up til now!

    Thread Starter kflogerzi

    (@kflogerzi)

    Ok… thats getting close to what I need. Sorry to need things spelled out so much.

    Theres actually more in my sidebar than just that. Here’s the entire sidebar code. I’d like to retain everything else in the sidebar on both homepage, and the internal. its just that one dynamic one that I only want on the home. So I’m guessing I follow the same principle just outlined, but with the rest of the code in the sidebar?

    Here’s the entire code for reference:

    <div id="sidebar">
    
    <ul>
    
        <?php /* Menu for subpages of current page (copied from K2 theme) */
    
        global $notfound;
    
        if (is_page() and ($notfound != '1')) {
    
            $current_page = $post->ID;
    
            while($current_page) {
    
                $page_query = $wpdb->get_row("SELECT ID, post_title, post_status, post_parent FROM $wpdb->posts WHERE ID = '$current_page'");
    
                $current_page = $page_query->post_parent;
    
            }
    
            $parent_id = $page_query->ID;
    
            $parent_title = $page_query->post_title;
    
            // if ($wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_parent = '$parent_id' AND post_status != 'attachment'")) {
    
            if ($wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_parent = '$parent_id' AND post_type != 'attachment'")) {
    
        ?>
    
      <div id="sidebar_back">
        <li>
          <ul class="list-page">
            <?php
    $output = wswwpx_fold_page_list('echo=0&depth=1&sort_column=menu_order&title_li=<h2 class="sidebartitle">Pages</h2>' );
    if (is_page( )) {
      $page = get_query_var('page_id');
      if ($post->post_parent) {
        $page = $post->post_parent;
      }
      $children=wswwpx_fold_page_list( 'echo=0&sort_column=menu_order&child_of=' . $page . '&title_li=' );
      if ($children) {
        $output = wswwpx_fold_page_list ('echo=0&sort_column=menu_order&child_of=' . $page . '&title_li=<h2 class="sidebartitle">Pages</h2>');
      }
    }
    echo $output;
    ?>
          </ul>
        </li>
      </div>
    
        <?php } } ?>
    
     <div id="minipost_back"> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?></div>
    
      <?php endif; ?>
    
     </ul>
    
     <p><img src="/images/logos/usa.jpg" /></p>
     <p><img src="/images/logos/sticker.gif" /></p>
    
    </div>
    
    <!--/sidebar -->
    Thread Starter kflogerzi

    (@kflogerzi)

    Oh ok great! That might work… ideally its only a section of the sidebar I don’t want to display:

    <div id="minipost_back"> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?></div>
    
      <?php endif; ?>

    Any thoughts on how I could not show that on the homepage?

Viewing 7 replies - 1 through 7 (of 7 total)