WordPress Best Practice. IDs or Page Title?
-
Hello,
I’d like to find out what is WordPress best practice when it comes to displaying content.
Currently i’m using the Page ID to display posts is this best practice or should I be using Title/slug?
Here is a small sample of what im doing
<?php`
$facilityName = get_the_ID();
switch ($facilityName)
{
case “359”:
$facilityName=’banners-brantford’;
break;
case “361”:
$facilityName=’banners-point-edward’;
break;
case “363”:
$facilityName=’banners-ssm’;
break;
default:
$facilityName=’1′;
echo “<p class=’loopErrorMessage’>New and exciting promotions and events are being added. Please check back at a later time for an update.</p>”;
}
?>
<?php $facility_banners = array( ‘category_name’ => $facilityName);
$facility_banners_loop = new WP_Query( $facility_banners); ?>`Thanks
The topic ‘WordPress Best Practice. IDs or Page Title?’ is closed to new replies.