Skip to content

Instantly share code, notes, and snippets.

@taniarascia
Last active Aug 29, 2015
Embed
What would you like to do?
Common Wordpress queries
/*
the_ and get_the are two different queries. For example, the_title(); will echo out the title field into your HTML document, and get_the_title(); can be inserted into a value.
*/
<?php the_title(); ?> // Title
<?php the_content(); ?> // Full entry
<?php the_excerpt(); ?> // Partial entry
<?php the_permalink(); ?> // Calls a specific link
<?php the_category(); ?> // Calls the category
<?php wp_reset_query(); ?> // Stop other loops. Sometimes necessary.
<?php if(is_page(78)) {
echo '1';
} else {
echo '2';
} ?>
<?php wp_list_pages('title_li=&exclude=268,276'); ?>
// Exclude page from list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment