A journal entry stamped: July 29th, 2010
This function is used to get the_permalink() of a certain page using it's ID (outside the loop). To use it within a theme, just:
function getPageLink($pageId){
if(!is_numeric($pageId)) {
return;
}
global $wpdb;
$sql_query = 'SELECT DISTINCT * FROM [...]
A journal entry stamped: July 29th, 2010
This function is used to get the title(); of a certain page using it's ID (outside the loop). To use it within a theme, just:
<?php getPageTitle(ID); ?>
function getPageTitle($pageId){
if(!is_numeric($pageId)) {
return;
}
global $wpdb;
$sql_query = 'SELECT DISTINCT * FROM ' . $wpdb->posts . ' WHERE ' . $wpdb->posts . '.ID=' . $pageId;
$posts = $wpdb->get_results($sql_query);
if(!empty($posts)) [...]
A journal entry stamped: July 29th, 2010
This function is used to construct breadcrumbs of pages, posts and archives within Wordpress. Put this on functions.php inside yout theme and call anywhere you need (single.php, page.php) using:
<?php the_breadcrumb(); ?>
function the_breadcrumb() {
$current = $post->ID;
$parent = $post->post_parent;
$grandparent_get = get_post($parent);
[...]
A journal entry stamped: August 4th, 2006
This is a very simple PHP Contact Form, that we usually use on some of our projects. It's very customizable, and easy to add fields (inputs, checkboxes, radio buttons.... anything). The most important, the form is tableless, I've used one DIV (container) and fieldset, legend and labels for the form [...]
0 Comments