Place excerpts with rich HTML (links)

This topic contains 2 replies, has 3 voices, and was last updated by  Paolo 7 years, 5 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #310910

    locololo2
    Free User
    Post count: 37

    Hi,

    I am using the gd_listings shortcode and am trying to add HTML links to the place excerpts.

    Here is the page I am working on: http://amador360-staging.mckmedia.co/amador-winery-map/

    I found this code in listings-listview.php but am not sure how to customize it, if possible.

    
    
    <?php
                                /**
                                 * Called before the post excerpt on the listings view template.
                                 *
                                 * @since 1.0.0
                                 * @param object $post The post object.
                                 * @see 'geodir_after_listing_post_excerpt'
                                 */
                                do_action('geodir_before_listing_post_excerpt', $post); ?>
                                <?php echo geodir_show_listing_info('listing'); ?>
                                <div class="geodir-entry-content">
    
                                    <?php
                                    /**
                                     * Filter to hide the listing excerpt
                                     *
                                     * @since 1.5.3
                                     * @param bool $display Display the excerpt or not. Default true.
                                     * @param string $view The view type, default 'listview'.
                                     * @param object $post The post object.
                                     */
                                    $show_listing_excerpt = apply_filters('geodir_show_listing_post_excerpt', true, 'listview', $post);
                                    if ($show_listing_excerpt) {
                                        if ( isset( $character_count ) && ( $character_count || $character_count == '0' ) ) {
                                            $content_out = geodir_max_excerpt( $character_count );
                                        } else {
                                            $content_out = get_the_excerpt();
                                        }
                                        if ( ! empty( $content_out ) ) {
                                            echo "<p>" . $content_out . "</p>";
                                        }
                                    }
                                    ?></div>
    
                                <?php
                                /**
                                 * Called after the post excerpt on the listings view template.
                                 *
                                 * @since 1.0.0
                                 * @param object $post The post object.
                                 * @see 'geodir_before_listing_post_excerpt'
                                 */
                                do_action('geodir_after_listing_post_excerpt', $post); ?>

    Thanks!

    #311184

    Guust
    Moderator
    Post count: 29970

    I am not even sure that is possible. But I’ll get the developers to have a look at your question too.
    You can always create a URL custom field to add to the Listings display:
    https://wpgeodirectory.com/docs/core-place-settings/#url
    https://wpgeodirectory.com/docs/core-place-settings/#common

    #311804

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    the excerpt will always strip html tags. You’d need to replace all the code related to the excerpt with your own functions:

    
    
    $show_listing_excerpt = apply_filters('geodir_show_listing_post_excerpt', true, 'listview', $post);
                                    if ($show_listing_excerpt) {
                                        if ( isset( $character_count ) && ( $character_count || $character_count == '0' ) ) {
                                            $content_out = geodir_max_excerpt( $character_count );
                                        } else {
                                            $content_out = get_the_excerpt();
                                        }
                                        if ( ! empty( $content_out ) ) {
                                            echo "<p>" . $content_out . "</p>";
                                        }
                                    }

    This request is considered a customization and goes beyond support.

    Thanks

Viewing 3 posts - 1 through 3 (of 3 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket