Style favourites list
-
I want to change the layout of the favourites list from the standard list output to a more styled one (with divs etc).
Does anyone know how I can achieve this?
I know the code section I want to use for the new look:
<div class="grid-50 mobile-grid-100 propertybox"> <div class="featuredimage"> <a href="<?php echo get_permalink( $item->post_id );?>"> <?php echo get_the_post_thumbnail( $item->post_id, 'full' ); ?> </a> </div><!-- end featuredimage --> <div class="grid-30"> <h4 class="pink price-page"> <?php the_ccyamt(get_field('property_price', $item->post_id)); ?> </h4> <br> <?php the_field('details', $item->post_id); ?> <br> <br> <p>REFERENCE: <?php the_field('reference_number', $item->post_id); ?></p> </div><!-- end grid-30 --> <div class="grid-70"> <h2 class="categorytitle"> <a href="<?php echo get_permalink( $item->post_id );?>"> <?php echo get_the_title( $item->post_id ); ?> </a> </h2> <?php //the_content(); $my_postid = $item->post_id; $content_post = get_post($my_postid); $content = $content_post->post_content; $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); echo $content; ?> <a href="<?php echo get_permalink( $item->post_id ); ?>" class="button floatright"> More Details </a> </div> </div>and I know it needs to go in somewhere around here:
private function setList() { $favorites = get_user_favorites($this->data['user_id']); $out = ""; foreach($favorites as $favorite){ $out .= '<li>'; if ( $this->data['links'] ) $out .= '<a href="' . get_permalink($favorite) . '">'; $out .= get_the_title($favorite); if ( $this->data['links'] ) $out .= '</a>'; $out .= '</li>'; echo 'Text goes here' } $this->list = $out; }on the FavoritesListHandler.php file.
Can anyone help me?
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
The topic ‘Style favourites list’ is closed to new replies.