alvarols
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: uri from archive.phpAnyone?
Forum: Fixing WordPress
In reply to: This string doesn't wokI finally just solved it.
This is wrong:
<?php query_posts($query_string . ‘cat=3&posts_per_page=1’); ?>This is right:
<?php query_posts($query_string . ‘&cat=3&posts_per_page=1’); ?>Forum: Fixing WordPress
In reply to: query_posts working on archive.php. How to??Anyone?
Forum: Fixing WordPress
In reply to: query_posts working on archive.php. How to?I tried to do this, but nothing appears:
<?php $current_year = date(‘Y’);
$current_month = date(‘m’); ?><div id="destizquierda"> <?php query_posts('cat=3&posts_per_page=1'); ?> <?php if(have_posts()) : ?><?php while (have_posts()) : the_post(); $wp_query->is_archive = true; ?> <h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1> <p><?php echo strip_tags(the_advanced_excerpt('length=500')); ?></p> <p class="leer"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>">Leer más</a></p> <?php endwhile; ?> <?php wp_reset_query(); ?> <?php endif; ?> </div>
Forum: Fixing WordPress
In reply to: This filter doesn't workSolved:
`<?php
? ? ? ? ? ? ? ? ? ? ? ? ? ? function filter_where($where = ”) {
? ? ? ? ? ? ? ? ? ? ? ? ? ? //posts in the last 24 Hours
? ? ? ? ? ? ? ? ? ? ? ? ? ? $where .= ” AND post_date > ‘” . date(‘Y-m-d H:i:s’, strtotime(‘-36 hours’)) . “‘”;
? ? ? ? ? ? ? ? ? ? ? ? ? ? return $where;
? ? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? ? ? add_filter(‘posts_where’, ‘filter_where’);
? ? ? ? ? ? ? ? ? ? ? ? ? ? $query = new WP_Query(“cat=”.$categoria.””);
? ? ? ? ? ? ? ? ? ? ? ? ?>
? ? ? ? ? ? ? ? ? ? ? ? <?php if(have_posts()) : ?><?php while($events_query->have_posts()) : $postnum = $postnum + 1; $events_query->the_post(); ?>
? ? ? ? ? ? ? ? ? ? ? ? <h1 class=”negrocentro”>“><?php the_title(); ?></h1>
? ? ? ? ? ? ? ? ? ? ? ? <?php endwhile; ?>
? ? ? ? ? ? ? ? ? ? ? ? <?php endif; ?>
? ? ? ? ? ? ? ? ? ? ? ? <?php
? ? ? ? ? ? ? ? ? ? ? ? ? ? remove_filter( ‘posts_where’, ‘filter_where’ );
? ? ? ? ? ? ? ? ? ? ? ? ?>Forum: Fixing WordPress
In reply to: Post loops from a specific interval of timeYes but I don’t know exactly how I have to do. I am checking this code.
// Create a new filtering function that will add our where clause to the query
function filter_where( $where = ” ) {
// posts 30 to 60 days old
$where .= ” AND post_date >= ‘” . date(‘Y-m-d’, strtotime(‘-60 days’)) . “‘” . ” AND post_date <= ‘” . date(‘Y-m-d’, strtotime(‘-30 days’)) . “‘”;
return $where;
}add_filter( ‘posts_where’, ‘filter_where’ );
$query = new WP_Query( $query_string );
remove_filter( ‘posts_where’, ‘filter_where’ );I can put something like, show me the posts published today from 8:00. But it won’t work from 12:00 AM to 7:59 AM the next day before my client publishs the new posts at 8:00 AM.
Forum: Fixing WordPress
In reply to: Problem with loop in single.phpThank you, it worked fine. There were the quotes.
In this case i could not replace $categoria with an ID because that ID were generated automatically.
Forum: Fixing WordPress
In reply to: Problem with special characters when i try to add an authorI’m trying to use the_author_posts_link() but I wan’t to know if there are another way to show the first name and last name.
Thanks
Forum: Fixing WordPress
In reply to: loop by year in wordpressThanks it worked
Forum: Fixing WordPress
In reply to: This Ajax Code doesn't work in WordPressThanks
Forum: Fixing WordPress
In reply to: This Ajax Code doesn't work in WordPressAre there an easiest way to learn how to use Ajax in WP?
Forum: Fixing WordPress
In reply to: This Ajax Code doesn't work in WordPressYes. Part of the js works well. But it stops when PHP have to say to the JS that the mail has been sent