Adding custom loop to plugin
-
I am trying to add a custom loop to the “BAW Manual Related Posts” plugin. I believe I need to use apply_filters but am unsure as to how I go about doing so. I’ve included the snippet from the plugin file that allows custom loops as well as my custom loop below. Any insight is appreciated. Thanks in advance!
Code from plugin file:
$list[] = '<li style="' . esc_attr( $style ) . '" class="' . $class . '"><a href="' . esc_url( apply_filters( 'the_permalink', get_permalink( $id ) ) ) . '">' . $thumb . '<br />' . apply_filters( 'the_title', get_the_title( $id ) ) . '</a></li>';
My custom loop:
<div class="home-property-item"> <div class="property-detail-block"> <div class="property-pic-wrapper"> <?php if ( has_post_thumbnail() ) { $image_id = get_post_thumbnail_id(); $image_url = wp_get_attachment_image_src($image_id,'full-size', true); { ?> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"> <?php } the_post_thumbnail('property-post-thumb',array( 'alt' => trim(strip_tags( get_the_title($post->ID) )), 'title' => trim(strip_tags( get_the_title($post->ID) )) )); ?> </a> <?php } ?> <?php $property_status = get_post_meta($post->ID, 'locality_status', true);?> <p class="<?php echo $property_status; ?>"> <?php echo $property_status; ?> </p> </div> <h4> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"> <?php the_title(); ?> </a> </h4> <div class="features-wrapper"> <span class="bed"><div class="value"><?php echo get_post_meta($post->ID, 'locality_property_bedrooms', true); ?></div> <?php _e('Beds') ?></span> <span class="bath"><div class="value"><?php echo get_post_meta($post->ID, 'locality_property_bathrooms', true); ?></div> <?php _e('Baths') ?></span> <span class="size"><div class="value"><?php echo get_post_meta($post->ID, 'locality_property_size', true); echo "</div> "; theme_unit(); ?></span> <div class="price-box"> <h5 class="price"> <?php theme_currency(); echo number_format(intval(get_post_meta($post->ID, 'locality_property_price', true))); ?> </h5> </div> </div> <div class="learnmore"> <a class="blue" href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">LEARN MORE</a> </div> </div> </div>
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Adding custom loop to plugin’ is closed to new replies.