Category Archives: PHP

Display the Post or Page slug in a WordPress theme template

It’s crazy that you have to add this function in yourself. But… you do. Firstly open up functions.php and paste the following in anywhere, like, ahh, at the very bottom: function the_slug() { $post_data = get_post($post->ID, ARRAY_A); $slug = $post_data['post_name']; return $slug; } And now, in your template, display the slug thus: <?php echo the_slug(); [...]

Display a Google Map in a hidden div, in a Drupal 6 node template, given values from CCK Location inside a CCK Multigroup

This was a real gnarly one. So I’m not going to describe the problem – I figure if you got here via Google, then you have a similar setup sequence as in the title of this post, and subsequently you’ll be hurting real bad and willing to look at any freakn’ code. CCK Multigroup for [...]