Add in your theme functions.php file the code below it will show the Ad ID on the Advert details page
add_action( "adverts_tpl_single_details", "my_adverts_tpl_single_show_id" );
function my_adverts_tpl_single_show_id( $post_id ) {
?>
<div class="adverts-grid-row">
<div class="adverts-grid-col adverts-col-30">
<span class="adverts-round-icon adverts-icon-wordpress"></span>
<span class="adverts-row-title">ID</span>
</div>
<div class="adverts-grid-col adverts-col-65">
<?php esc_html_e( $post_id ) ?>
</div>
</div>
<?php
}
Thread Starter
David
(@loano1)
Hi Greg, Thanks for your code! Is it possible to replace the “adverts-icon-wordpress”? The reason for that, the “ID” text is not visible on mobile so I would create an icon-image containing “ID”.
And would it be possible to show the id above the location (below category)? Otherwise, it will be separated and moved down below the map.
-
This reply was modified 7 years, 7 months ago by
David.
1. to change icon replace adverts-icon-wordpress with some other FontAwesome icon name (but remember to prefix the icon name with adverts-icon-).
2. it is not possible to display the ID above location at least not without modifying wpadverts/templates/single.php template file.