Mysql workbenck update mode off

SET SQL_SAFE_UPDATES=0;

Advertisements

Change url to all the site in mysql

use database;

— SET SQL_SAFE_UPDATES=0;  //if is myworkbench

update wp_options
set option_value=replace(option_value,”previous_url”,”new_url”)
where option_value like “%previous_url%”;

update wp_posts
set guid=replace(guid,”previous_url”,”new_url”)
where guid like “%previous_url%”;

update wp_postmeta
set meta_value=replace(meta_value,”previous_url”,”new_url”)
where meta_value like “%previous_url%”;

Mostrar dos categorias de post en la misma pagina

query_posts(array(‘category_name’=>’news’,’showposts’ => 5));

if ( have_posts() ){
$contador = 0;
$cadena = ‘<div class=”one_ul”>’;
$cadena .= ‘<ul>’;
while ( have_posts() ) : the_post();
$contador += 1;
if($contador == 4){
$cadena .= ‘</ul>’;
$cadena .= ‘</div>’;
$cadena .= ‘<div class=”two_ul”>’;
$cadena .= ‘<ul>’;
}
$cadena .= ‘<li><a href=”‘.get_permalink($post->ID).’”>’.get_the_title().’</a></li>’;
endwhile;
$cadena .= “</ul>”;
$cadena .= “</div>”;
}
echo $cadena;
<?php wp_reset_query(); ?>

query_posts(array(‘category_name’=>’blogs’,’showposts’ => 3));
if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<article class=”blog_article”>
<?php if(has_post_thumbnail()){ ?>
<a class=”feature-image” href=”<?php the_permalink(); ?>”>
<?php the_post_thumbnail($thumb); ?>
</a>
<?php } ?>
<div>
<h3><a href=”<?php the_permalink(); ?>”><?php the_title();?></a></h3>
<?php
the_excerpt();
?>
</div>
</article>
<?php endwhile; ?>