MyListing Share Tags Generator
The {CODICTS} MyListing Share Tags Generator plugin allows listing owners to generate shareable HTML snippets or plain URLs for their published listings directly from the User Listings Dashboard. Site administrators create Share Tag Forms — configurable templates that define which sharing options are available and what defaults are set. The plugin also supports a hide header/footer mode that strips the site chrome from shared links, ideal for embedding listings in iframes or sharing them as standalone pages.
No child theme required: Unlike most CoDicts plugins, this plugin does not require a child theme. It works entirely through WordPress hooks and filters without modifying any theme template files.
Installation & Activation
Start by downloading the plugin from the Downloads page on your dashboard on the CoDicts website.
After downloading, install and activate the plugin in WordPress by navigating to “Plugins” > “Add New” > “Upload Plugin” and selecting the downloaded zip file. Click “Install Now” and then “Activate”.
After activation, a new {CODICTS} MyListing Share Tags Generator menu item appears in the WordPress admin sidebar. You need to create at least one Share Tag Form for the “Share” action to appear on the User Listings Dashboard.
Note: If the MyListing theme is not detected, an admin error notice is shown and the plugin’s functionality is disabled.
Key Features
| Feature | Description |
|---|---|
| Shareable Tag Generation | Listing owners generate copy-paste HTML snippets or plain URLs for their listings from the dashboard. |
| Hide Header/Footer Mode | Shared links can strip the site header, footer, and admin bar for a clean standalone view — ideal for iframe embedding. |
| HTML Link Tag Output | Optionally wraps the URL in an <a> tag with configurable attributes. |
| Image Embedding | Optionally embeds an <img> tag inside the link using a custom or default image URL. |
| New Tab Support | Optionally adds target="_blank" so the link opens in a new tab. |
| Per-Listing-Type Targeting | Share Tag Forms can be assigned to specific listing types, or applied globally to all types. |
| Admin Form Builder | Full admin interface for creating, editing, duplicating, and deleting Share Tag Forms. |
| Toggle Visibility Control | Each option can be shown or hidden on the frontend modal, locking values to admin-set defaults when hidden. |
| Live Preview | The share tag snippet updates in real-time as listing owners toggle options in the modal. |
How It Works
The plugin works in two parts:
Admin side: Site administrators create Share Tag Forms — configurable templates that define default options and which controls are visible to listing owners.
Frontend side: When listing owners visit their User Listings Dashboard, a “Share” action link appears on each published listing that has a matching Share Tag Form. Clicking “Share” opens a modal where the owner can toggle options and copy the generated snippet.
Creating a Share Tag Form
1. Navigate to {CODICTS} MyListing Share Tags Generator → Add New in the WordPress admin.
2. Enter a title for the form (e.g., “Default Share Form,” “Restaurant Share Form”).
3. Configure the Share Tag Form settings (see below).
4. Click Save.
Share Tag Form Settings
Each setting has two parts: a default value (the pre-set option) and a “Show on frontend?” toggle that controls whether listing owners can see and change the option in the modal.
| Setting | Options | Default | Description |
|---|---|---|---|
| Target Listing Type(s) | Multi-select of listing types | Empty (all) | Which listing types this form applies to. Leave blank to apply to all listing types. |
| Use HTML Link Tag? | Yes / No | No | When Yes, the output is wrapped in an <a> tag. When No, the output is a plain URL. |
| Use image URL? | Yes / No | No | When Yes, embeds an <img> tag inside the link. Only applies when HTML Link Tag is enabled. |
| Default image URL | Text | Empty | A default image URL to use when image embedding is enabled. |
| Open in new tab? | Yes / No | No | When Yes, adds target="_blank" to the link. Only applies when HTML Link Tag is enabled. |
| Hide header/footer? | Yes / No | No | When Yes, appends ?cdts-hf=1 to the URL. When someone visits this URL, the site header, footer, and admin bar are hidden. |
Frontend Toggle Visibility
Each of the five main settings (HTML Link Tag, image URL, default image URL, new tab, hide header/footer) has a companion “Show on frontend?” checkbox:
| When Checked | When Unchecked |
|---|---|
| The option appears as a visible toggle in the frontend modal. Listing owners can change it. | The option is hidden from the modal. The admin-set default value is used and listing owners cannot change it. |
This gives you full control over what listing owners can customize. For example, you might always force “Hide header/footer” to Yes by setting the default to Yes and unchecking “Show on frontend?”
Targeting Specific Listing Types
You can create different Share Tag Forms for different listing types:
1. Create a form and use the “Target Listing Type(s)” multi-select to choose which listing types it applies to.
2. Leave the field blank to create a catch-all form that applies to all listing types.
When multiple forms exist, the plugin prioritizes specific matches over catch-all matches. If a listing type has both a specific form and a catch-all form, the specific form is used.
Note: If no form matches a listing’s type, the “Share” link does not appear for that listing.
Frontend: Generating a Share Tag
Here’s what listing owners experience:
1. Navigate to the User Listings Dashboard (the “My Listings” page).
2. For each published listing that has a matching Share Tag Form, a “Share” action link appears.
3. Click “Share” to open the share tag modal.
4. Toggle the available options as desired. The generated snippet updates live in the textarea below.
5. Click the textarea to select all content, then copy and paste it wherever needed — external websites, emails, or any HTML context.
6. Click “Close” to dismiss the modal.
Output Examples
| Configuration | Generated Snippet |
|---|---|
| Plain URL, no options | https://example.com/listing/my-listing/ |
| Plain URL + hide header/footer | https://example.com/listing/my-listing/?cdts-hf=1 |
| HTML link tag, no extra options | <a title="My Listing" href="https://example.com/listing/my-listing/">My Listing</a> |
| HTML link tag + new tab + hide | <a title="My Listing" href="https://example.com/listing/my-listing/?cdts-hf=1" target="_blank">My Listing</a> |
| HTML link tag + image + hide | <a title="My Listing" href="https://example.com/listing/my-listing/?cdts-hf=1"><img src="https://example.com/image.png" /></a> |
Hide Header/Footer Mode
When the “Hide header/footer” option is enabled, the generated URL includes ?cdts-hf=1 as a query parameter. When someone visits this URL, the plugin injects CSS that hides:
| Element Hidden | Description |
|---|---|
<header> | The site header. |
<footer> | The site footer. |
#wpadminbar | The WordPress admin bar (for logged-in users). |
| Elementor footer widgets | Footer sections built with Elementor. |
| MyListing top content margin | The spacing MyListing adds below the header. |
The result is a clean, standalone listing page with no site navigation or chrome. This is ideal for:
— Embedding listings in <iframe> tags on external websites.
— Sharing listings as focused, standalone views.
— Creating clean printable listing views.
Managing Share Tag Forms
The admin list table at {CODICTS} MyListing Share Tags Generator → Share Tag Forms provides full management:
| Action | Description |
|---|---|
| Edit | Modify an existing form’s settings. |
| Duplicate | Create a copy of a form with “_copy” appended to the title. |
| Delete | Permanently remove a form. Listings matched to this form will lose their “Share” link (unless another form matches them). |
| Bulk Delete | Select multiple forms and delete them at once. |
| Search | Search forms by title. |
| Sort | Sort by Title, Author, or Date (ascending or descending). |
Example Setup
Here’s a practical setup for a directory site with “Restaurant” and “Hotel” listing types:
1. Create a form titled “Restaurant Share Form.” Target the “Restaurant” listing type. Set defaults: HTML Link Tag = Yes, Hide header/footer = Yes. Uncheck “Show on frontend?” for “Hide header/footer” to always force it on. Save.
2. Create a form titled “Hotel Share Form.” Target the “Hotel” listing type. Set defaults: HTML Link Tag = Yes, Use image URL = Yes, set a default hotel placeholder image. Save.
3. Create a form titled “Catch-All Share Form.” Leave “Target Listing Type(s)” blank so it applies to all other listing types. Set defaults to plain URL only. Save.
Now restaurant owners get HTML links with hidden headers by default, hotel owners get image-embedded links, and all other listing types get simple URL sharing.
Frequently Asked Questions
Do I need a child theme?
No. Unlike most CoDicts plugins, this one does not require a child theme. It works entirely through WordPress hooks and filters.
Where do I configure the plugin?
Navigate to {CODICTS} MyListing Share Tags Generator in the WordPress admin sidebar. From there you create and manage Share Tag Forms.
Why don’t I see the “Share” link on my listings?
The “Share” link only appears when all three conditions are met: the listing is published, at least one Share Tag Form exists, and the form either targets the listing’s type specifically or targets all listing types (catch-all).
Can I have different share tag options for different listing types?
Yes. Create separate Share Tag Forms and assign each to specific listing types using the “Target Listing Type(s)” field. Leave the field blank to create a catch-all that applies to all types.
What if multiple forms match the same listing type?
The plugin uses the first match, prioritizing forms that specifically target the listing type over catch-all forms. To avoid confusion, assign each listing type to only one specific form.
Can I prevent listing owners from changing certain options?
Yes. Each option has a “Show on frontend?” toggle. Uncheck it to hide that option from the modal — the admin-set default value will be used and listing owners cannot change it.
What does “Hide header/footer” actually do?
It appends ?cdts-hf=1 to the URL. When visited, the plugin injects CSS that hides the site header, footer, admin bar, and Elementor footer widgets. The listing page appears as a clean standalone view without any site navigation. This is purely visual — the HTML elements remain in the page source.
Can listing owners share draft or pending listings?
No. The “Share” action link only appears for listings with a status of “publish.” Draft, pending, and expired listings do not show the share option.
What happens when I delete a Share Tag Form?
The “Share” link disappears for listings that were matched to that form, unless another form matches them. No listing data is affected.
Can I duplicate a Share Tag Form?
Yes. Both the list table and the edit page have a “Duplicate” action that creates a copy with “_copy” appended to the title.
Does the generated snippet update automatically if my listing URL changes?
No. The snippet is generated at the moment the listing owner opens the modal and copies it. If the listing URL changes later, the owner would need to regenerate and re-copy the snippet.
Troubleshooting
“Share” Link Not Appearing on the User Listings Dashboard
| Cause | Solution |
|---|---|
| No Share Tag Form exists | Create at least one Share Tag Form in the admin: {CODICTS} MyListing Share Tags Generator → Add New. |
| Form doesn’t target the listing type | Edit the form and either add the listing type to “Target Listing Type(s)” or leave it blank to match all types. |
| Listing is not published | The “Share” link only appears for published listings. Check the listing status. |
| Plugin not activated | Go to Plugins → Installed Plugins and verify the plugin is active. |
Modal Opens but Shows No Options
| Cause | Solution |
|---|---|
| AJAX error | Check the browser console (F12 → Console) for errors. The AJAX request to load modal options may be failing due to a nonce expiry — try refreshing the page. |
| All frontend toggles unchecked | If all “Show on frontend?” checkboxes are unchecked in the form settings, no visible options appear. The snippet still generates using the admin-set defaults, but the modal may look empty. Consider enabling at least one visible option. |
Hide Header/Footer Not Working
| Cause | Solution |
|---|---|
| Custom theme structure | The hide feature targets standard <header> and <footer> HTML elements, plus #wpadminbar and Elementor footer widgets. If your theme uses non-standard HTML structure, the CSS selectors may not match. Custom CSS may be needed. |
| Caching | Page caching may serve the non-hidden version. Clear your site cache and try visiting the URL with ?cdts-hf=1 again. |
“MyListing Theme Not Detected” Error
The MyListing theme must be installed and active. Go to Appearance → Themes to verify.
For further support, visit codicts.com or contact us at support@codicts.com.