Jump to content

How to make a link use a slug


cerberus478

Recommended Posts

Hi

I'm using wordpress and I want to create a link that will use the slug of an item from the database. For example if the user clicks on view of an item, then the link must direct the user to a page that will have more information of the item.

I have this

<?php global $wpdb;
$bras = $wpdb->get_results("SELECT * FROM bras;");
?> [/size][/font][/color]


<table>
<?php foreach($bras as $bra): ?>


<td><?php echo $bra->title ?><br />
<img src="<?php echo bloginfo('template_directory').'/img/'.$bra->filename; ?>" /><br />
<?php echo $bra->content ?><br />
<?php echo $bra->price ?><br />


<a href="#" />View</a>


<?php endforeach; ?>
</td>
</table>

and then the user will click view and then get directed to bras_view which will then give the information of the item,

Link to comment
https://forums.phpfreaks.com/topic/273137-how-to-make-a-link-use-a-slug/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.