I want to create a simple menu function which can call it example get_menu()
Here is my current code.
<?php
$select = 'SELECT * FROM pages';
$query = $db->rq($select);
while ($page = $db->fetch($query)) {
$id = $page['id'];
$title = $page['title'];
?>
<a href="page.php?id=<?php echo $id; ?>" title="<?php echo $title; ?>"><?php echo $title; ?></a>
<?php } ?>
How to do that in?
function get_menu() {
}
Let me know.
Here is the function for that:
.
Some Quick Corrections In Your Script:
=afterid&aftertitleSuggestion:
You can give your menu links a class and style as per your menu needs 🙂