Hello @fariszarif,
Thank you for reaching out.
You can create a custom function that outputs the links without escaping the HTML. Here is a basic example of how you might generate the links with a custom shortcode function. Add the following code to your theme’s functions.php
file or a custom code snippet plugin:
function directorist_listings_shortcode() {
$args = array(
'post_type' => 'at_biz_dir',
'posts_per_page' => -1,
);
$query = new WP_Query($args);
$output = '';
if ($query->have_posts()) {
$output .= '<ul>';
while ($query->have_posts()) {
$query->the_post();
$post_title = get_the_title();
$post_link = get_permalink();
$output .= '<li><a href="' . esc_url($post_link) . '">' . esc_html($post_title) . '</a></li>';
}
$output .= '</ul>';
} else {
$output .= 'No posts found.';
}
wp_reset_postdata();
return $output;
}
add_shortcode('directorist_listings_link_with_title', 'directorist_listings_shortcode');
Then, you can use [directorist_listings_link_with_title]
shortcode in any post or page to display the list of links.
Feel free to let us know if you have any questions or require additional assistance.
Regards,
Al-Amin Khan
Directorist Support Team.