I hereby claim:
- I am cynthiapereira on github.
- I am cynthiapereira (https://keybase.io/cynthiapereira) on keybase.
- I have a public key ASBU3Mj3edxb3fvkBXcOH3ofxePvt2ICuwKzrtXezojr6Ao
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| git remote add upstream <url-do-repositorio-original> | |
| git fetch upstream | |
| git checkout master | |
| git reset --hard upstream/master | |
| git push origin master --force |
| <?php | |
| //Pega todas as categorias do post | |
| $cats = get_the_category($post->ID); | |
| //Verifica a primeira categoria retornada e pega seu parentesco. | |
| //Se um post tem múltiplas categorias que levam a parentescos separados, retornará o primeiro parentesco pertencente à primeira categoria retornada. | |
| $parent = get_category($cats[0]->category_parent); | |
| //Se obtiver uma mesnagem de erro, significa que já estamos na categoria-pai. | |
| if (is_wp_error($parent)){ |
| class My_Recent_Posts_Widget extends WP_Widget_Recent_Posts { | |
| function widget($args, $instance) { | |
| extract( $args ); | |
| $title = apply_filters('widget_title', empty($instance['title']) ? __('Tópicos recentes') : $instance['title'], $instance, $this->id_base); | |
| if( empty( $instance['number'] ) || ! $number = absint( $instance['number'] ) ) | |
| $number = 5; | |
| $r = new WP_Query( apply_filters( 'widget_posts_args', array( 'posts_per_page' => $number, 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true ) ) ); | |
| if( $r->have_posts() ) : |
| add_action( 'right_now_content_table_end' , 'my_right_now_content_table_end' ); | |
| function my_right_now_content_table_end() { | |
| $args = array( | |
| 'public' => true , | |
| '_builtin' => false | |
| ); | |
| $output = 'object'; | |
| $operator = 'and'; | |
| $post_types = get_post_types( $args , $output , $operator ); |
| function page_navi($pages = '', $range = 2){ | |
| $showitems = ($range * 2)+1; | |
| global $paged; | |
| if(empty($paged)) $paged = 1; | |
| if($pages == ''){ | |
| global $wp_query, $wpdb; | |
| $pages = $wp_query->max_num_pages; |
| class Bootstrap_Walker_Nav_Menu extends Walker_Nav_Menu { | |
| function start_lvl( &$output, $depth ) { | |
| //In a child UL, add the 'dropdown-menu' class | |
| $indent = str_repeat( "\t", $depth ); | |
| $output .= "\n$indent<ul class=\"dropdown-menu\">\n"; | |
| } | |
| function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { | |
| $indent = ( $depth ) ? str_repeat( "\t", $depth ) : ''; |
| add_filter('wp_title', 'my_wp_title', 10, 2); | |
| function my_wp_title($title, $sep){ | |
| global $paged, $page; | |
| if (is_feed()) { | |
| return $title; | |
| } | |
| // Add o nome do site. | |
| $title .= get_bloginfo('name'); |
| UPDATE wp_options | |
| SET option_value = REPLACE(option_value, 'http://localhost/site', 'http://www.site.com.br') | |
| WHERE option_name = 'home' | |
| OR option_name = 'siteurl'; | |
| UPDATE wp_posts | |
| SET guid = REPLACE (guid, 'http://localhost/site', 'http://www.site.com.br'); | |
| UPDATE wp_posts | |
| SET post_content = REPLACE (post_content, 'http://localhost/site', 'http://www.site.com.br'); |