Yes, this is possible but you need to add some PHP code into your theme to achieve it. Place something similar to the second block of code below into your theme’s functions.php
file (if it doesn’t have such a file you can create it at wp-content/themes/<your-theme>/functions.php
with the first snippet below, to which you can add the second code block as you would if the file already existed:
<?php
add_action( 'a_z_listing_item_indices', 'exclude_a_z_pages' );
function exclude_a_z_pages( $indices, $item, $type ) {
if ( in_array( $item->ID, array(
5, // exclude post with ID of '5'
6, // exclude post with ID of '6'
7, // exclude post with ID of '7'
// add further ID numbers here separated by commas (,) to exclude them
) ) {
$indices = array();
}
return $indices;
}
The second code block needs to be either after <?php
, and before ?>
if it is present. This is a rule of how the PHP engine recognises that the code is PHP rather than HTML.
-
This reply was modified 6 years, 8 months ago by
Dani Llewellyn. Reason: add info about tags