This file contains 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
#!/bin/bash | |
# requires lynx,grep,awk,uniq,sort,egrep,head,xargs,wget,tar adn rm | |
lynx -dump http://br.wordpress.org/releases | /bin/grep "\.tar\.gz$" | awk -F'http://' '{ print "http://"$2 }' | uniq | sort -r | /bin/egrep -v 'RC|beta' | head -n1 | xargs wget -O wordpress-br.tar.gz | |
tar -xvf wordpress-br.tar.gz | |
/bin/rm wordpress-br.tar.gz |
This file contains 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
$(document).ready(function(){ | |
// this is the container we'll load content into | |
var container = $('#target'); | |
// adding a tabIndex of -1 makes it keyboard accessible, | |
// and we can set the focus to it | |
container.attr('tabIndex','-1'); | |
// if a user clicks on an element with the class ajaxtrigger... |
This file contains 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
<select name="Combo_Estados"> | |
<option value="AC">AC</option> | |
<option value="AL">AL</option> | |
<option value="AM">AM</option> | |
<option value="AP">AP</option> | |
<option value="BA">BA</option> | |
<option value="CE">CE</option> | |
<option value="DF">DF</option> | |
<option value="ES">ES</option> | |
<option value="GO">GO</option> |
This file contains 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
//JS (Jquery) | |
var serializedData = $('#myForm').serialize(); | |
$.post( | |
'getSerializedData.php', | |
{data:serializedData}, | |
function(data){ | |
} | |
) | |
// PHP | |
$serializedData = $_POST['data']; |
This file contains 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 | |
$taxonomyName = "slug-da-minha-taxonomia"; | |
$terms = get_terms($taxonomyName,array('parent' => 0)); | |
foreach($terms as $term) : | |
echo '<a href="'.get_term_link($term->slug,$taxonomyName).'">'.$term->name.'</a>'; | |
$term_children = get_term_children($term->term_id,$taxonomyName); | |
echo '<ul>'; | |
foreach($term_children as $term_child_id) : | |
$term_child = get_term_by('id',$term_child_id,$taxonomyName); | |
echo '<li><a href="' . get_term_link( $term_child->name, $taxonomyName ) . '">' . $term_child->name . '</a></li>'; |
This file contains 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
add_theme_support( | |
'infinite-scroll', | |
array( | |
'type' => 'scroll', | |
'footer_widgets' => false, | |
'container' => 'products', | |
'wrapper' => false, | |
'render' => false, | |
'posts_per_page' => get_option( 'posts_per_page' ) | |
) |
This file contains 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( | |
'post_type' => 'oferta', | |
'posts_per_page' => 12, | |
'order' => 'DESC' | |
); | |
$q = new WP_Query($args); | |
global $post; | |
while ($q->have_posts()) : $q->the_post(); ?> |
This file contains 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
<li> | |
<div class="img"> | |
<?php $imgsrc = wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); ?> | |
<img src="<?php echo $imgsrc; ?>"> | |
</div> | |
<div class="description"> | |
<header><?php the_title(); ?></header> | |
<div><?php the_content(); ?></div> | |
<?php $metas = get_post_meta( $post->ID ); ?> | |
<div>Est.: <?php echo $metas['estoque'][0]; ?> unidades</div> |
This file contains 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
/* | |
* Get all images EXCEPT post thumbnail | |
*/ | |
<?php if ( $post->post_type == 'data-design' && $post->post_status == 'publish' ) { | |
$attachments = get_posts( array( | |
'post_type' => 'attachment', | |
'posts_per_page' => -1, | |
'post_parent' => $post->ID, | |
'exclude' => get_post_thumbnail_id() |
This file contains 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
find /var/www -type f -print0 | xargs -0 grep -li 'search string' |
OlderNewer