Remove Product Description GD
August 7, 2025 · AI Conversations
—
### ✅ Option 1: Using a Code Snippet (Best practice)
1. **Find the template hook** used in the listing archive loop.
GeoDirectory uses templates like:
– `geodir-loop.php`
– `geodir-listing-loop.php`
– Hooks like `geodir_before_listing_title`, `geodir_after_listing_title`, `geodir_after_listing_content`, etc.
2. **Add this code in your child theme’s `functions.php` or via Code Snippets plugin:**
function remove_geodirectory_listing_description() {
remove_action('geodir_after_listing_content', 'geodir_action_listings_description', 15);
}
add_action('wp', 'remove_geodirectory_listing_description');
If that doesn't work, try changing the hook to `init` or `template_redirect`.
—
### ✅ Option 2: Override the Template File
1. Copy the listing loop template from plugin to your theme:
– From:
`wp-content/plugins/geodirectory/geodirectory-templates/`
File might be: `geodir-listing-loop.php` or `geodir-loop-list.php`
– To:
`wp-content/themes/your-child-theme/geodirectory/`
2. Edit the copied file, and **remove or comment out** the section like:
<div class="geodir-entry-content">
<?php the_excerpt(); ?>
</div>
3. Save and test. This gives full control but requires more maintenance on plugin updates.
—
### ✅ Option 3: CSS (Quick & Dirty — not preferred)
If you want a temporary visual hide:
.geodir-entry-content {
display: none !important;
}
Add this to **Appearance → Customize → Additional CSS**.
—
### 📝 Bonus: Identify Correct Hook
If unsure which hook renders the description:
1. Temporarily enable this in `functions.php`:
add_action('all', function($hook) {
if (strpos($hook, 'geodir') !== false) {
echo $hook . '<br>';
}
});
2. Reload the listing page and check which hook outputs the description.
—
Would you like me to review your specific template file or help write a custom one based on your layout?
—
### ✅ 1. **Using GeoDirectory Built-In Layout Editor (Drag & Drop UI)**
GeoDirectory provides a visual way to control how listings are displayed.
#### 📍 Steps:
1. Go to **WP Admin > GeoDirectory > Settings**.
2. Click **"Design"**.
3. Choose **"Listing Details"** tab.
4. You'll see layout builders for:
– **Listing Detail Page**
– **Listing Archive (Listing Cards/Grid)**
5. You can **drag & drop widgets** like:
– Title
– Address
– Excerpt/Description
– Price
– Image
– Custom Fields
6. Remove or reorder elements as needed (e.g., **remove "Post Content"** if you don’t want the description).
#### 🔄 Save changes and refresh your site to see them applied.
—
### ✅ 2. **Customize via Custom Post Type UI & Custom Fields**
If you're using **GeoDirectory CPTs (like “Places”)**, you can customize what appears using:
– **Custom fields** from:
– **GeoDirectory > Custom Post Types > Places > Custom Fields**
– Toggle visibility:
– You can set visibility of fields on archive/detail views.
—
### ✅ 3. **Optional: Use Elementor or Block Editor (With GeoDirectory Add-ons)**
If you have the **GeoDirectory Elementor add-on**:
– You can build the **listing detail layout with Elementor**, choosing what elements to show/hide.
– Go to: `Pages > Listing Template (Place)` and edit with Elementor.
—
### ✅ 4. **Manage Excerpt or Description Content per Listing**
Each listing in **Places > All Places > Edit** has:
– Title
– Description (post content)
– Custom fields
If you don’t want to show the full description:
– Use the **Excerpt** field instead.
– Control visibility via **Layout Editor** or **hook removals** as shown earlier.
—
### Summary Table:
| Task | Method |
|————————————–|————————————————————————|
| Remove product/description text | GeoDirectory → Settings → Design → Remove "Post Content" widget |
| Rearrange listing layout | Drag/drop in Design tab |
| Add/remove custom fields | GeoDirectory → CPT → Places → Custom Fields |
| Fine-tune layout (advanced) | Elementor Add-on or custom template override |
—
Let me know if you're using **Elementor**, **Block Editor**, or classic PHP template — I can provide layout editing instructions tailored to that setup.
<script>
/* <![CDATA[ */
jQuery(function () {
try {
var params = <?php echo json_encode( $params ); ?>;
params['action'] = 'geodir_widget_listings';
params['widget_args'] = <?php echo json_encode( $args ); ?>;
params['security'] = geodir_params.basic_nonce;
geodir_widget_listings_pagination('<?php echo $unique_id; ?>', params);
} catch (err) {
console.log(err.message);
}
});
/* ]]> */
</script>
<style>
<?php echo $carousel_row; ?>.carousel-item.active, <?php echo $carousel_row; ?>.carousel-item-<?php echo ( $aui_bs5 ? 'start' : 'left' ); ?>, <?php echo $carousel_row; ?>.carousel-item-<?php echo ( $aui_bs5 ? 'end' : 'right' ); ?> {
display: flex;
}
<?php echo $carousel_row; ?>.carousel-item {
margin-left: auto;
}
</style>
$template = $design_style ? $design_style . '/content-widget-listing.php' : 'content-widget-listing.php';
And then it's loaded using:
echo geodir_get_template_html(
$template,
array(
'widget_listings' => $widget_listings,
'column_gap_class' => $instance['column_gap'] ? 'mb-' . absint( $instance['column_gap'] ) : 'mb-4',
'row_gap_class' => $instance['row_gap'] ? 'px-' . absint( $instance['row_gap'] ) : '',
'card_border_class' => $card_border_class,
'card_shadow_class' => $card_shadow_class,
)
);
—
### ✅ So where is the actual file?
#### 1. **Default path (from plugin)**:
/wp-content/plugins/geodirectory/templates/content-widget-listing.php
Or if using a design style like `default` or `modern`:
/wp-content/plugins/geodirectory/templates/modern/content-widget-listing.php
—
### ✅ To override the template:
You can **copy it into your child theme**:
#### Path in child theme:
/wp-content/themes/your-child-theme/geodirectory/content-widget-listing.php
Or for design-style-based override:
/wp-content/themes/your-child-theme/geodirectory/modern/content-widget-listing.php
Then, **edit the template and remove this part (or similar)** to hide the description/excerpt:
<div class="geodir-entry-content">
<?php the_excerpt(); ?>
</div>
—
### ✅ Summary
– **Template file**: `content-widget-listing.php`
– **Default location**: `/plugins/geodirectory/templates/[design]/`
– **Override location**: `/themes/your-child-theme/geodirectory/[design]/`
– **Remove product description**: delete or comment out `the_excerpt()` or `the_content()` in the template
—
Let me know your active design style (`default`, `modern`, etc.), and I can give you the exact file path or help edit the file if you paste its contents.