MauMaster
Respostas no Fórum
-
Fórum: Outros assuntos
Em resposta a: Link para o Google Plus no meu siteOlá Alessandro, isso acontece para que google possa verificar que seu site, é de fato tenha certeza que o perfil do google plus realmente é do dono do site.
Se quer esse tive de verificação é preciso deixar.
Mas pode por em baixo sem problemas, não precisa ficar no contato superiorFórum: Ajustando o WordPress
Em resposta a: Problema com function.phpVe se ajuda amigo
<?php
include(‘opcoes-tema.php’);
/* ————————————————
Register WP 3.0 Menus
———————————————— */add_action( ‘init’, ‘register_my_menus’ );
function register_my_menus() {
register_nav_menus(
array(
‘top-menu’ => __( ‘Top Menu’, ‘vectors’ ),
‘main-menu’ => __( ‘Main Menu’, ‘vectors’ ),
‘footer-menu’ => __( ‘Footer Menu’, ‘vectors’ )
)
);
}/* ————————————————
Register Sidebars
———————————————— */if ( function_exists(‘register_sidebar’) ) {
register_sidebar(array(
‘name’ => ‘Sidebar’,
‘id’ => ‘sidebar’,
‘before_widget’ => ‘<div id=”%1$s” class=”widget %2$s”>’,
‘after_widget’ => ‘</div>’,
‘before_title’ => ‘<h3 class=”widget-title”>’,
‘after_title’ => ‘</h3>’,
));register_sidebar(array(
‘name’ => ‘Homepage Banner’,
‘id’ => ‘banner-content’,
‘before_widget’ => ‘<div class=”widget-content-banner”><div id=”%1$s” class=”widget %2$s”>’,
‘after_widget’ => ‘</div></div><div class=”widget-content-banner-bottom”></div>’,
‘before_title’ => ‘<div id=”%1$s” class=”widget %2$s”>’,
‘after_title’ => ‘</h3>’,
));
register_sidebar(array(
‘name’ => ‘Post Banner’,
‘id’ => ‘banner-post’,
‘before_widget’ => ‘<div class=”widget-content-banner”><div id=”%1$s” class=”widget %2$s”>’,
‘after_widget’ => ‘</div></div><div class=”widget-content-banner-bottom”></div>’,
‘before_title’ => ‘<h3 class=”widget-title”>’,
‘after_title’ => ‘</h3>’,
));
}/* ————————————————
Add Post Thumbnail (Featured Thumbnail) Support
———————————————— */if ( function_exists( ‘add_theme_support’ ) ) { // Added in 2.9
add_theme_support( ‘post-thumbnails’ );
set_post_thumbnail_size( 222, 150, true ); // Default thumbnails
add_image_size( ‘large’, 600, 250, true ); // Large thumbnails
add_image_size( ‘medium’, 285, 175, true ); // Medium thumbnails
add_image_size( ‘small’, 83, 55, true ); // Small thumbnails
}/* ————————————————
Remove Extra <p> Tags From Excerpt Output
———————————————— */// RESUMO
function resumo($palavras){
$result = explode(‘ ‘, get_the_excerpt(), $palavras);
if (count($result) >= $palavras) {
array_pop($result);
$result = implode(” “,$result).’ […]’;
} else {
$result = implode(” “,$result);
}
echo $result;
}
/* ————————————————
Add Twitter To User Contact Details In WP Admin
———————————————— */function vectors_add_twitter( $vectors_method ) {
$vectors_method[‘twitter’] = ‘Twitter (Username Only)’;
return $vectors_method;
}
add_filter(‘user_contactmethods’, ‘vectors_add_twitter’, 10, 1);/* ————————————————
Generate Template Class
———————————————— */function vectors_get_template_class() {
global $post;$tpl[‘template-full-width.php’] = ‘content-full-width’;
$tpl[‘template-image-gallery.php’] = ‘content-full-width’;
$tpl[‘template-sidebar-left.php’] = ‘content-sidebar-left’;$post_tpl = get_post_meta($post->ID, ‘_wp_page_template’, true);
return isset($tpl[$post_tpl]) ?$tpl[$post_tpl] : ”;
}/* ————————————————
Calculate An Accurate Comment Count
———————————————— */function vectors_comment_count( $count ) {
if ( ! is_admin() ) {
global $id;
$comments_by_type = &separate_comments(get_comments(‘status=approve&post_id=’ . $id));
return count($comments_by_type[‘comment’]) + count($comments_by_type[‘pings’]);
} else {
return $count;
}
}
add_filter(‘get_comments_number’, ‘vectors_comment_count’, 0);function vectors_pings_count() {
global $post;
$comments_by_type = &separate_comments(get_comments(‘status=approve&post_id=’ . $post->ID));
count($comments_by_type[‘pings’]);
}/* ————————————————
Custom Callback – Comments
———————————————— */function custom_callback($comment, $args, $depth) {
$GLOBALS[‘comment’] = $comment; ?><li <?php comment_class(); ?> id=”li-comment-<?php comment_ID() ?>”>
<?php if ($comment->comment_type == ”){ ?>
<div id=”comment-<?php comment_ID(); ?>” class=”comment-body”>
<div class=”post-img fl”><?php echo get_avatar($comment,$size=’90’); ?>
<p class=”comment-url”><?php echo get_comment_author_link(); ?></p>
<p class=”comment-date”><?php echo get_comment_date(‘d/m/Y’); ?></p>
</div>
<div class=”comment-author”></div>
<div class=”comment-text”>
<?php if ($comment->comment_approved == ‘0’) : ?>
<?php _e(‘Your comment is awaiting approval.’, ‘vectors’) ?><?php endif; ?>
<?php comment_text() ?>
<p class=”comment-reply”><?php comment_reply_link(array_merge($args, array(‘depth’ => $depth, ‘max_depth’ => $args[‘max_depth’]))) ?></p>
</div>
</div>
<?php } else { ?>
<div id=”comment-<?php comment_ID(); ?>” class=”comment-body”><div class=”comment-text”>
<?php if ($comment->comment_approved == ‘0’) : ?>
<?php _e(‘Your comment is awaiting approval.’, ‘vectors’) ?><?php endif; ?>
<?php echo get_comment_author_link() . ‘ – ‘ . get_comment_date(‘d/m/Y’); ?></div>
</div>
<?php } ?>
<div class=”clear”></div>
<?php }/* ————————————————
Include Theme Files
———————————————— */// Widgets
include(“functions/widgets/widget-tweets.php”);
include(‘functions/widgets/widget-facebook.php’);
include(‘functions/widgets/widget-plus.php’);
include(‘functions/widgets/widget-rss.php’);
include(‘functions/widgets/widget-artigos-populares.php’);
// Theme Settingsfunction thumb_url(){
if (isset($post->ID)){
$src = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), array( 2100,2100 ));
$src = $src[0];
return $src;
}
}if ( function_exists( ‘add_image_size’ ) ) {
add_image_size( ‘formato_novo’, 600, 300, true );
}add_filter(‘image_size_names_choose’, ‘meu_tamanho_padrao’);
function meu_tamanho_padrao($sizes) {
$addsizes = array(
“formato_novo” => __( “Novo Formato”)
);
$newsizes = array_merge($sizes, $addsizes);
return $newsizes;
}function migalha_escola() {
$delimiter = ‘»’;
$home = ‘Início’; // text for the ‘Home’ link
$before = ‘<span>’; // tag before the current crumb
$after = ‘</span>’; // tag after the current crumbif ( !is_home() && !is_front_page() || is_paged() ) {
echo ‘<div id=”nav_migalha”>’;
global $post;
$homeLink = get_bloginfo(‘url’);
echo ‘‘ . $home . ‘ ‘ . $delimiter . ‘ ‘;if ( is_category() ) {
global $wp_query;
$cat_obj = $wp_query->get_queried_object();
$thisCat = $cat_obj->term_id;
$thisCat = get_category($thisCat);
$parentCat = get_category($thisCat->parent);
if ($thisCat->parent != 0) echo(get_category_parents($parentCat, TRUE, ‘ ‘ . $delimiter . ‘ ‘));
echo $before . single_cat_title(”, false) . $after;} elseif ( is_day() ) {
echo ‘‘ . get_the_time(‘Y’) . ‘ ‘ . $delimiter . ‘ ‘;
echo ‘‘ . get_the_time(‘F’) . ‘ ‘ . $delimiter . ‘ ‘;
echo $before . get_the_time(‘d’) . $after;} elseif ( is_month() ) {
echo ‘‘ . get_the_time(‘Y’) . ‘ ‘ . $delimiter . ‘ ‘;
echo $before . get_the_time(‘F’) . $after;} elseif ( is_year() ) {
echo $before . get_the_time(‘Y’) . $after;} elseif ( is_single() && !is_attachment() ) {
if ( get_post_type() != ‘post’ ) {
$post_type = get_post_type_object(get_post_type());
$slug = $post_type->rewrite;
echo ‘labels->singular_name.'”>’ . $post_type->labels->singular_name . ‘ ‘ . $delimiter . ‘ ‘;
echo $before . get_the_title() . $after;
} else {
$cat = get_the_category(); $cat = $cat[0];
echo get_category_parents($cat, TRUE, ‘ ‘ . $delimiter . ‘ ‘);
echo $before . get_the_title() . $after;
}} elseif ( !is_single() && !is_page() && get_post_type() != ‘post’ && !is_404() ) {
$post_type = get_post_type_object(get_post_type());
echo $before . $post_type->labels->singular_name . $after;} elseif ( is_attachment() ) {
$parent = get_post($post->post_parent);
$cat = get_the_category($parent->ID); $cat = $cat[0];
echo get_category_parents($cat, TRUE, ‘ ‘ . $delimiter . ‘ ‘);
echo ‘post_title.'”>’ . $parent->post_title . ‘ ‘ . $delimiter . ‘ ‘;
echo $before . get_the_title() . $after;} elseif ( is_page() && !$post->post_parent ) {
echo $before . get_the_title() . $after;} elseif ( is_page() && $post->post_parent ) {
$parent_id = $post->post_parent;
$breadcrumbs = array();
while ($parent_id) {
$page = get_page($parent_id);
$breadcrumbs[] = ‘ID) . ‘” rel=”bookmark” title=”‘.get_the_title($page->ID).'”>’ . get_the_title($page->ID) . ‘‘;
$parent_id = $page->post_parent;
}
$breadcrumbs = array_reverse($breadcrumbs);
foreach ($breadcrumbs as $crumb) echo $crumb . ‘ ‘ . $delimiter . ‘ ‘;
echo $before . get_the_title() . $after;} elseif ( is_search() ) {
echo $before . ‘Resultados para o termo: “‘ . get_search_query() . ‘”‘ . $after;} elseif ( is_tag() ) {
echo $before . ‘Artigos com a etiqueta ‘ . single_tag_title(”, false) . $after;} elseif ( is_author() ) {
global $author;
$userdata = get_userdata($author);
echo $before . ‘Artigos publicados por ‘ . $userdata->display_name . $after;} elseif ( is_404() ) {
echo $before . ‘Error 404’ . $after;
}if ( get_query_var(‘paged’) ) {
if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ‘ (‘;
echo __(‘Page’) . ‘ ‘ . get_query_var(‘paged’);
if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ‘)’;
}echo ‘</div>’;
}
}/* Add Author Box */
function add_autor_box_escola() {
$author_box = ‘<div id=”authorarea”>’;
$author_box .= get_avatar(get_the_author_meta(‘email’), ‘100’ );
$author_name = get_the_author();
$author_desc = get_the_author_meta(‘description’);$author_box .= ‘<div class=”author_social”>’;
if (get_the_author_meta(‘facebook’) <> ”){
$author_box .= ‘<img src=”‘. get_bloginfo(‘template_directory’) . ‘/images/facebook-author.png” alt=”facebook” />‘;
}
if (get_the_author_meta(‘twitter’) <> ”){
$author_box .= ‘<img src=”‘. get_bloginfo(‘template_directory’) . ‘/images/twitter-author.png” alt=”twitter” />‘;
}
if (get_the_author_meta(‘plus’) <> ”){
$author_box .= ‘<img src=”‘. get_bloginfo(‘template_directory’) . ‘/images/plus-author.png” alt=”google plus” />‘;
}
$author_box .= ‘</div>’;$author_box .= ‘
<div class=”authorinfo”>
<h3>’ . $author_name . ‘</h3>’;$author_box .= $author_desc . ‘</div>
</div>’;
return $author_box;
}function paginacao_escolasites($paginas = ”, $numlinks = 2)
{
$qtde = ($numlinks * 2)+1;global $paged;
if(empty($paged)) $atual = 1; else $atual = $paged;if($paginas == ”)
{
global $wp_query;
$paginas = $wp_query->max_num_pages;
if(!$paginas)
{
$paginas = 1;
}
}if($paginas != 1)
{
echo “<div class=’paginacao’>”;
if($atual > 2 && $atual > $numlinks + 1 && $qtde < $paginas) echo “« Primeira“;
if($atual > 1 && $qtde < $paginas) echo “«“;for ($i=1; $i <= $paginas; $i++)
{
if (1 != $paginas &&( !($i >= $atual + $numlinks + 1 || $i <= $atual – $numlinks – 1) || $paginas <= $qtde ))
{
echo ($atual == $i)? “<span class=’atual’>”.$i.”</span>”:”“.$i.”“;
}
}if ($atual < $paginas && $qtde < $paginas) echo “»“;
if ($atual < $paginas – 1 && $atual + $numlinks – 1 < $paginas && $qtde < $paginas) echo “» Última“;
echo “<div class=’paginas’>Página “. $atual . ” de ” . $paginas . “</div>”;
echo “</div>\n”;
}
}add_filter(‘wp_nav_menu_items’,’search_box_function’, 10, 2);
function search_box_function( $nav, $args ) {
if( $args->theme_location == ‘main-menu’ )
return $nav. ‘<li class=”menu-header-search”><form action=”‘ . get_bloginfo(‘url’) . ‘”>
<input type=”text” class=”search-input” placeholder=”Pesquise no site” name=”s” title=”Pesquise no site”>
</form>’;return $nav;
}function custom_loginlogo() {
echo ‘<style type=”text/css”>
h1 a {background-image: url(‘.get_bloginfo(‘template_directory’).’/images/logo.png) !important; }
</style>’;
}
//add_action(‘login_head’, ‘custom_loginlogo’);
add_image_size(“miniatura-loop”, 220, 250, true);add_filter(‘user_contactmethods’, ‘social_user_contactmethods’);
function social_user_contactmethods($user_contactmethods){
$user_contactmethods[‘twitter’] = ‘Twitter’;
$user_contactmethods[‘facebook’] = ‘Facebook’;
$user_contactmethods[‘plus’] = ‘Google Plus’;
return $user_contactmethods;
}add_shortcode(‘caixa_rss’, ‘func_caixa_rss’);
function func_caixa_rss() {
return ‘<div id=”receber”>
<h4>Assine nossas atualizações e receba um Ebook sobre SEO GRÁTIS!</h4><div class=”ebook”><img src=”http://www.escolasites.com/wp-content/uploads/2012/03/ebook-artigos.jpg” /></div>
<div class=”texto”>
<p>Quase 500 pessoas já assinaram nossa NEWSLETTER, inteiramente GRÁTIS, e aprendem todos os dias como criar e melhorar seus blogs e sites. Assine também e receba o ebook sobre como colocar seu Blog no topo do GOOGLE, apenas coloque seu email na caixa abaixo e clique em DOWNLOAD GRÁTIS.</p>
<form class=”newsletter” action=”http://feedburner.google.com/fb/a/mailverify” method=”post” target=”popupwindow” onsubmit=”window.open(\’http://feedburner.google.com/fb/a/mailverify?uri=escolaphp\’, \’popupwindow\’, \’scrollbars=yes,width=550,height=520\’);return true”>
<input style=”display: initial;” id=”input-rss” class=”input-rss” type=”text” name=”email” />
<input type=”hidden” value=”escolaphp” name=”uri” /><input type=”hidden” name=”loc” value=”pt_BR” />
<input id=”btn-assinar” class=”mais” style=”width: 180px;margin-top: 1px;font-size: 15px;” type=”submit” value=” DOWNLOAD GRÁTIS” />
</form>
</div>
</div>’;
}
add_shortcode(‘add_link’, ‘func_add_link’);function func_add_link($atts){
extract(shortcode_atts(array(
“tipo” => ”,
“link” => ‘http://www.escolasites.com’
), $atts));if ($tipo == ‘demonstracao’){
$label = ‘Demonstração’;
}
else if($tipo == ‘download’){
$label = ‘Download’;
}
return ‘<p align=”center” class=”‘ . $tipo . ‘”>‘ .$label . ‘</p>’;
}
add_filter(‘avatar_defaults’,’gravatarescola’);function gravatarescola($avatar_defaults) {
$myavatar = get_bloginfo(‘template_directory’) . ‘/images/gravatar-escola.jpg’;
$avatar_defaults[$myavatar] = “Escola Sites”;
return $avatar_defaults;
}
function artigos_populares($qtde){
$html = ‘<h4>Artigos Populares</h4>’;
$html .= ‘- ‘;
- ” title=”‘ . $title . ‘”>’;
$html .= $title . ‘ {‘ . $commentcount . ‘}
global $wpdb;
$result = $wpdb->get_results(“SELECT comment_count,ID,post_title FROM $wpdb->posts ORDER BY comment_count DESC LIMIT 0 , ” . $qtde);
foreach ($result as $post) {
setup_postdata($post);
$postid = $post->ID;
$title = $post->post_title;
$commentcount = $post->comment_count;
if ($commentcount != 0) {
$html .= ‘‘;
}
}
$html .= ‘‘;
return $html;
}Fórum: Ajustando o WordPress
Em resposta a: Problema com function.phpNão tem o function.php do template salvo no pc?
Poderia enviar via ftp para substituirFórum: Ajustando o WordPress
Em resposta a: Imaem destacadaValeu Pessoal
- ” title=”‘ . $title . ‘”>’;