Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • BillyBob

    (@williamkharvey)

    As a short time fix until an update you could try the following. Add to functions right at the top.

    				// Shim to fix the late load of the WooCommerce autoloader.
    				if ( defined( 'WC_PLUGIN_FILE' ) && ! function_exists( 'wc_get_loop_prop' ) ) {
    					$woocommerce_file = dirname( WC_PLUGIN_FILE ) . '/includes/wc-template-functions.php';
    					if ( file_exists( $woocommerce_file ) ) {
    						require_once $woocommerce_file;						
    					}
    				}
    • This reply was modified 4 years, 6 months ago by BillyBob.
    Thread Starter BillyBob

    (@williamkharvey)

    I agree that this would be the simple solution but the boss is asking for password protection. Would you happen to know if that’s at all possible here?

    Thread Starter BillyBob

    (@williamkharvey)

    And do you have a demo of the pro version, the current demo doesn’t allow me to add an auction so I can’t see how the reverse bidding works.

    Thread Starter BillyBob

    (@williamkharvey)

    OK, I sorted this.

    I missed out the echo.

    Here’s the final working code…

    <?php
        $children = get_pages('child_of='.$post->ID);
        $parent = $post->post_parent;
        $siblings =  get_pages('child_of='.$parent);
        if( count($children) != 0) {
           $args = array(
             'depth' => 1,
             'title_li' => '',
             'child_of' => $post->ID,
             'echo' => 0
           );
        } elseif($parent != 0) {
            $args = array(
                 'depth' => 1,
                 'title_li' => '',
                 'exclude' => $post->ID,
                 'child_of' => $parent,
                 'echo' => 0
               );
        }
    
        if(count($siblings) > 1 && !is_null($args))  
    
    $list = wp_list_pages($args);
    $list_elements = explode('</li>', $list);
    $num = count($list_elements)-1;
    
    $col = 2; //set the number of columns
    $num_col = ceil($num/$col);
    $width = floor(100/$col)-0;
    $style = 'width:'.$width.'%;margin-right:0%;padding-left:0%;float:left;';
    
    for( $i=1; $i<$col; $i++) { $list_elements[$i*$num_col] = '</ul><ul class="related-practice-areas" style="'.$style.'">'.$list_elements[$i*$num_col]; }
    $list = implode('</li>', $list_elements); ?>
    
    <ul class="related-practice-areas" style=" <?php echo $style; ?>">
    <?php echo $list; ?>
    </ul>
Viewing 4 replies - 1 through 4 (of 4 total)