Cómo obtener fechas de publicaciones

  • Autor Autor carp88
  • Fecha de inicio Fecha de inicio
C

carp88

Delta
Hola, necesito sacas las fechas de los posts. My theme es suffusion, Enlace eliminado. Ahi les copio el single.php

PHP:
<?php
/**
 * Single book template for the Now Reading plugin.
 *
 * @package Suffusion
 * @subpackage NowReading
 */

get_header();
global $nr_id, $suffusion_unified_options;
foreach ($suffusion_unified_options as $id => $value) {
	$$id = $value;
}
?>

<div id="main-col">
<?php suffusion_before_begin_content(); ?>
	<div id="content">
<?php suffusion_after_begin_content(); ?>
        <div class="post fix nr-post">

<?php
if( have_books(intval($nr_id)) ) {
	while ( have_books(intval($nr_id)) ) {
		the_book();
?>
        <h1 class="posttitle"><?php book_title(); ?></h1>

			<div class="rating">
				Rating: <?php echo book_rating(false); ?>
<!--				<img src="<?php bloginfo('template_directory')?>/images/<?php book_rating() ?>.png" height="20px" title="Rating: <?php book_rating()?>" alt="Rating: <?php book_rating()?>" />-->
			</div>
<?php
		if( can_now_reading_admin() ) {
?>
			<div class="edit">
				<a href="<?php book_edit_url(); ?>">Edit this book</a>
			</div>

			<div class="manage">
				<a href="<?php manage_library_url(); ?>"><?php _e('Manage Books', NRTD);?></a>
			</div>
<?php
		}
?>
		</div>

		<div class="bookentry fix">
			<div class="stats">
				<a href="<?php book_url(); ?>" title="<?php if (!is_custom_book()) { ?>Buy <?php echo esc_attr(book_title(false));?> from Amazon<?php }?>"><img src="<?php book_image(); ?>" alt="<?php echo esc_attr(book_title(false)); ?>" /></a>
				<br/>
				<p>
<?php
		if ($suf_nr_single_added_show == 'show') {
				echo $suf_nr_single_added_text;
				echo book_added(false);
?>
				</p>
				<p>
<?php
		}
		if ($suf_nr_single_started_show == 'show') {
			echo $suf_nr_single_started_text;
			echo book_started(false);
?>
				</p>
				<p>
<?php
		}
		if ($suf_nr_single_finished_show == 'show') {
			echo $suf_nr_single_finished_text;
			echo book_finished(false);
?>
				</p>
				<p>
<?php
		}
		if ($suf_nr_single_meta_show == 'show') {
?>
					<?php print_book_meta(0); ?>
<?php
		}
?>
				</p>
			</div>

			<div class="review">
<?php
		book_review();
		if(book_has_post()) {
?>
				<p>This book is linked with the post <a href="<?php book_post_url() ?>">&ldquo;<?php book_post_title() ?>&rdquo;</a>.</p>
<?php
		}
?>
			</div><!--/.review -->

		<?php
			$tags = print_book_tags(false);
			if (trim($tags) != "") {
		?>
			<div class="post-footer fix">
				<span class="tags"><?php _e('Tagged with: ', 'suf_theme'); print_book_tags(1); ?></span>
			</div><!--/.post-footer -->
		<?php
			}
		?>
		</div><!-- bookentry -->
<?php
	}
}
else {
?>
		<h2 class='posttitle'><?php _e("Not Found", "suf_theme"); ?></h2>
		<div class='entry'>
			<p><?php _e("Sorry, but you are looking for something that isn't here", "suf_theme"); ?></p>
		</div>
<?php
}
//library_search_form();
?>

<!--		<p><a href="<?php library_url() ?>">&larr; Back to library</a></p>-->
	</div><!-- post -->

	</div><!-- content -->
</div><!-- left-col -->

<?php
get_footer();
?>
 
Última edición:
¿Podrias darnos la url? (para revisar porque a simple vista no lo vi)
 
Pera' pera' pera' vos queres sacar la fecha de los posts ¿no? Por ejemplo la que aparece aca: Enlace eliminado
Eso es parte del theme... y vos estas mostrando el codigo de un plugin... con razon no encontraba la fecha.
¿Es asi no?
 
Si, quiero sacar esa fecha que aparece en rosa. Pero esecodigo es el codigo de single.php . Osea llegue en apariencia>editor>single.php Por favor alguie nqeu me ayude, estoy hace rato con esto y no encuentro time ni nada parecido...
 
Creo que ese es no es el codigo del single.php sino de otro cosa... por favor verifica y vuelvelo a pegar.

saludos
 
Busca en single.php o en index.php o en home.php la función the_date().
 
que raro!! tienes que buscar la funcion the_time en alguna parte, yo creo que estará en el index.php :S
 
Tampoco.. este es el index.php:
PHP:
<?php
/**
 * Core file required with every WP theme. We have files for everything else.
 * So this is essentially the landing page if nothing else is set.
 * This is also the file used for archives.
 *
 * @package Suffusion
 * @subpackage Templates
 */

global $suffusion_unified_options;
foreach ($suffusion_unified_options as $id => $value) {
	$$id = $value;
}

get_header();
suffusion_query_posts();
?>
	<div id="main-col">
<?php suffusion_before_begin_content(); ?>
		<div id="content" class="hfeed">
<?php
if ($suf_index_excerpt == 'list') {
	if (!function_exists('get_template_part')) {
		include_once(TEMPLATEPATH . '/layouts/layout-list.php');
	}
	else {
		get_template_part('layouts/layout-list');
	}
}
else if ($suf_index_excerpt == 'tiles') {
	suffusion_after_begin_content();
	if (!function_exists('get_template_part')) {
		include_once(TEMPLATEPATH . '/layouts/layout-tiles.php');
	}
	else {
		get_template_part('layouts/layout-tiles');
	}
}
else {
	suffusion_after_begin_content();
	if (!function_exists('get_template_part')) {
		include_once(TEMPLATEPATH . '/layouts/layout-blog.php');
	}
	else {
		get_template_part('layouts/layout-blog');
	}
}
?>
      </div><!-- content -->
    </div><!-- main col -->
<?php
get_footer();
?>
 
Busca the_date() en todos los archivos que se encuentran en layouts/
 
Ahora busco, hay un archivo que se llama date.php Lo borre todo peor no cambio nada en la pagina..

en suffusion.php aparece lo siguiente:
PHP:
<?php
/**
 * Core class for Suffusion. This holds the options for the theme.
 *
 * @package Suffusion
 * @subpackage Functions
 */
class Suffusion {
	var $context;

	function init() {
	}

	function get_context() {
		if (is_array($this->context)) {
			return $this->context;
		}

		$this->context = array();
		if (is_front_page()) {
			$this->context[] = 'home';
		}

		if (is_home()) {
			$this->context[] = 'blog';
		}

		if (is_singular()) {
			global $post;
			$this->context[] = 'singular';
			$this->context[] = "{$post->post_type}";
			if ($post->post_type == 'page') {
				$page_template = get_page_template();
				if (strlen($page_template) > strlen(TEMPLATEPATH)) {
					$page_template = substr($page_template, strlen(TEMPLATEPATH) + 1);
				}
				$this->context[] = $page_template;
			}
		
}
		else if (is_archive()) {
			$this->context[] = 'archive';
			if (is_date()) {
				$this->context[] = 'date';
			}

			else if (is_category()) {
				$this->context[] = 'taxonomy';
				$this->context[] = 'category';
			}
			else if (is_tag()) {
				$this->context[] = 'taxonomy';
				$this->context[] = 'tag';
			}
			else if (is_author()) {
				$this->context[] = 'author';
			}
		}
		else if (is_search()) {
			$this->context[] = 'search';
		}
		else if (is_404()) {
			$this->context[] = '404';
		}

		return $this->context;
	}
}

?>

Ahi dice date, peor cuando borro esa parte no cambia nada de la pagina..
 
No deberías borrar ningún archivo... es solo una sugerencia...

busca algo asi como the_date()
 
Atrás
Arriba