Return to Snippet

Revision: 51132
at September 15, 2011 16:11 by mejamiewilson


Initial Code
<?php

	//Use the Page Id
	$page_data = get_page(86); 
		
	$title = $page_data->post_title;
	$content = apply_filters('the_content', $page_data->post_content);
	$image = get_the_post_thumbnail($page_id);
	$link = preg_replace("/[^A-Za-z0-9]/","",$title);
	
	echo '<a name="'.$link.'"></a>';
	echo '<h3>'.$title.'</h3>';
	echo $content;
	echo '<a href="'.get_option('siteurl').'/services/enquire?service='.$link.'">Enquire</a>';
		
?>

Initial URL


Initial Description
Using the ID of a page, you can get the content, the featured image and the title to power widgets in your template.

Initial Title
Using Pages in Wordpress to power Widgets

Initial Tags
image, wordpress

Initial Language
PHP