This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$query = new WP_Query(); | |
$all_pages = $query->query( | |
array( | |
'post_type' => 'page', | |
'orderby' => 'post_title', | |
'order' => 'ASC', | |
'posts_per_page' => -1)); | |
$children = get_page_children(get_the_ID(), $all_pages); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Dentro do functions.php no diretório do tema, adicione o seguinte código: | |
/* | |
* Post Type: NOME | |
*/ | |
add_action('init', 'post_type_register'); | |
function post_type_register() { | |
$labels = array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var div_to_be_aligned = $('#middle'); | |
var new_margin_top = 0; | |
var descontos = 0; | |
new_margin_top = (document.height - descontos - div_to_be_aligned.height()) / 2; | |
new_margin_top = new_margin_top + descontos / 2; | |
div_to_be_aligned.css('margin-top', new_margin_top + 'px'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$query = new WP_Query( | |
array( | |
'post_type' => '<post-type-name>' | |
) | |
); | |
if ($query->have_posts()) { | |
while ($query->have_posts()) { | |
$query->the_post(); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$images = get_posts( | |
array( | |
'post_type' => 'attachment', | |
'post_parent' => get_the_ID(), | |
'exclude' => get_post_thumbnail_id() // to exclude the featured image | |
) | |
); | |
foreach($images as $image){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$pages = get_pages( | |
array( | |
'sort_order' => 'ASC', | |
'sort_column' => 'menu_order', | |
'post_type' => 'page', | |
'posts_per_page' => 999 | |
) | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine On | |
RewriteCond %{HTTP_HOST} ^copacabanaclub\.com\.br$ | |
RewriteRule ^(.*) http://www.copacabanaclub.com.br/$1 [R=301] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo get_post_meta(get_the_ID(), 'key', true); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$cats = get_the_category(get_the_id()); | |
$separator = ', '; | |
$output = ''; | |
foreach($cats as $cat){ | |
$output = | |
'<a href="'. | |
get_category_link($cat->term_id). | |
'" title="'. | |
esc_attr(sprintf(__("Veja todos os posts em %s"), $cat->name)). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$args = array( | |
'type' => 'post', | |
'child_of' => 0, | |
'parent' => '', | |
'orderby' => 'ID', | |
'order' => 'ASC', | |
'hide_empty' => 0, | |
'taxonomy' => 'category', | |
'exclude' => 1); |
OlderNewer