Skip to content

Instantly share code, notes, and snippets.

@tinotriste
tinotriste / the_title.php
Created April 15, 2013 13:32
Wordpress: The post/page title
<?php the_title(); ?>
@tinotriste
tinotriste / the_excerpt.php
Created April 15, 2013 13:30
Wordpress: The post/page excerpt
<?php the_excerpt(); ?>
@tinotriste
tinotriste / display-subpages.php
Last active December 16, 2015 05:58
Wordpress: Display subpages of a page with their custom meta
<?php
$args = array( 'orderby' => 'menu_order', // Allows users to set order of subpages
'order' => 'ASC',
'post_parent' => $post->ID,
'post_type' => 'page',
'post_status' => 'publish'
); $postslist = get_posts($args);
?>
<?php foreach ($postslist as $post) : setup_postdata($post); ?>
@tinotriste
tinotriste / post-thumbnail.php
Created April 15, 2013 11:25
Wordpress: Get post thumbnail/featured image
<?php
if ( has_post_thumbnail() ) {
the_post_thumbnail();
}
?>
@tinotriste
tinotriste / breadcrumbs-functions.php
Last active April 20, 2024 05:36
Wordpress: Breadcrumbs function
<?php
/*=============================================
= BREADCRUMBS =
=============================================*/
// to include in functions.php
function the_breadcrumb() {
$sep = ' > ';
@tinotriste
tinotriste / functions.php
Last active December 16, 2015 05:29 — forked from Knivrobot/functions.php
Wordpress: Use session cookies
<?php
//Enable sessions i wordpress
if ( !session_id() )
add_action( 'init', 'session_start' );
?>
@tinotriste
tinotriste / ie-conditional-comments.html
Last active December 16, 2015 05:29 — forked from ryarwood/if-ie.html
HTML: IE conditional comments
<!--[if IE]>
According to the conditional comment this is IE<br />
<![endif]-->
<!--[if IE 6]>
According to the conditional comment this is IE 6<br />
<![endif]-->
<!--[if IE 7]>
According to the conditional comment this is IE 7<br />
@tinotriste
tinotriste / get_template_directory_uri.php
Created April 15, 2013 01:31
Wordpress: Get template URI
<?php echo get_template_directory_uri(); ?>
@tinotriste
tinotriste / get_footer.php
Created April 15, 2013 01:28
Wordpress: Get footer
@tinotriste
tinotriste / get_header.php
Created April 15, 2013 01:26
Wordpress: Get header
<?php get_header(); ?>