• Resolved walbadynamics

    (@walbadynamics)


    I want to publish category and location descriptions, but they are not published, what is the best way to make the description visible?

    Can you tell me the code to insert or a way to solve it! Thanks

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Mahfuzul Alam

    (@mahfuz87)

    Hi

    Thank you for reaching out.
    There is a way to show the category/location description and picture on the frontend. Would you please show us where you want to show these fields? You can also share the URL of the page.
    We will try to provide a solution.

    Regards

    Thread Starter walbadynamics

    (@walbadynamics)

    I have a standard elementor hello theme, I want to display text descriptions of categories and locations on the site to display

    https://ce02238.tw1.ru/single-location/dubai/?directory_type=general

    Thread Starter walbadynamics

    (@walbadynamics)

    I want to display the description field at the bottom of the page, under the ads

    https://prnt.sc/GrxxaL6m2LvA

    Plugin Support Mahfuzul Alam

    (@mahfuz87)

    Hi

    Thank you for waiting. You can override the templates to achieve this. Please go through this documentation and learn more about template overriding –
    Template Override (directorist.com)
    You need to override the following template to show the description on a taxonomy archive page –
    /directorist/templates/archive/grid-view.php
    Please use the following code to override this template using a child theme –

    <?php
    
    /**
    
    * @author wpWax
    
    * @since 6.6
    
    * @version 7.3.0
    
    */
    
    use \Directorist\Helper;
    
    if (!defined('ABSPATH')) exit;
    
    ?>
    
    <div class="directorist-archive-items directorist-archive-grid-view">
    
    <?php do_action('directorist_before_grid_listings_loop'); ?>
    
    <div class="<?php Helper::directorist_container_fluid(); ?>">
    
    <?php if ($listings->have_posts()) : ?>
    
    <div class="<?php echo $listings->has_masonry() ? 'directorist-masonry' : ''; ?> <?php Helper::directorist_row(); ?>">
    
    <?php foreach ($listings->post_ids() as $listing_id) : ?>
    
    <div class="<?php Helper::directorist_column($listings->columns); ?> directorist-all-listing-col"><!-- directorist-all-listing-col -->
    
    <?php $listings->loop_template('grid', $listing_id); ?>
    
    </div>
    
    <?php endforeach; ?>
    
    </div>
    
    <?php do_action('directorist_before_listings_pagination'); ?>
    
    <?php
    
    if ($listings->show_pagination) {
    
    $listings->pagination();
    
    }
    
    ?>
    
    <?php do_action('directorist_after_grid_listings_loop'); ?>
    
    <?php else : ?>
    
    <div class="directorist-archive-notfound"><?php esc_html_e('No listings found.', 'directorist'); ?></div>
    
    <?php endif; ?>
    
    </div>
    
    <?php
    
    $description = '';
    
    $atbdp_location = get_query_var('atbdp_location');
    
    $atbdp_category = get_query_var('atbdp_category');
    
    if ($atbdp_location) {
    
    $location = get_term_by('slug', $atbdp_location, ATBDP_LOCATION);
    
    if ($location) $description = $location->description;
    
    }
    
    if ($atbdp_category) {
    
    $category = get_term_by('slug', $atbdp_category, ATBDP_CATEGORY);
    
    if ($category) $description = $category->description;
    
    }
    
    ?>
    
    <p><?php echo $description; ?></p>
    
    </div>

    I believe this will work fine on your website and shows the description below the taxonomy archive page as you want it.
    Please inform us if you need further assistance with this.

    Kind Regards

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How do I publish category descriptions and category pictures?’ is closed to new replies.