Añade nueva página de inicio y mejoras de estilo

This commit is contained in:
Manuel Cillero 2021-08-03 21:05:18 +02:00
parent 6f9b7ff421
commit 2394be9383
9 changed files with 357 additions and 113 deletions

View file

@ -1,11 +1,11 @@
<?php
/**
* Flexible Posts Widget: Old Default widget template
*
*
* @since 1.0.0
*
* This is the ORIGINAL default template used by the plugin.
* There is a new default template (default.php) that will be
* There is a new default template (default.php) that will be
* used by default if no template was specified in a widget.
*/
@ -23,38 +23,38 @@ if( $flexible_posts->have_posts() ):
<ul class="dpe-flexible-posts">
<?php while( $flexible_posts->have_posts() ) : $flexible_posts->the_post(); global $post; ?>
<li id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php
if ($post->post_type == 'quote') {
$quote_text = get_the_content();
$author = wp_get_post_terms($post->ID, 'quote_author_tag', array("fields" => "all"));
$quote_author = '<p>— <a href="/quotes/author/' . $author[0]->slug . '">' . $author[0]->name . '</a></p>';
} else {
$quote_text = get_the_content();
$quote_author = get_the_title();
$provider = wp_get_post_terms($post->ID, 'quote_provider_tag', array("fields" => "all"));
switch ($provider[0]->name) {
case 'Proverbia.net':
$quote_text = mb_convert_encoding($quote_text, 'ISO-8859-15', 'UTF-8');
$quote_author = mb_convert_encoding(substr($quote_author, 0, strpos($quote_author, ' &#8211; ')), 'ISO-8859-15', 'UTF-8');
$quote_provider = '<a href="http://es.proverbia.net" target="_blank">' . $provider[0]->name . '</a>';
break;
case 'BrainyQuote':
$quote_provider = '<a href="http://www.brainyquote.com" target="_blank">' . $provider[0]->name . '</a>';
break;
case 'The Quotations Page':
$quote_provider = '<a href="http://www.quotationspage.com" target="_blank">' . $provider[0]->name . '</a>';
}
$quote_text = '<p>' . trim($quote_text, '"') . '</p>';
$quote_author = '<p>— ' . $quote_author . ' (' . $quote_provider . ')</p>';
}
echo '<div class="quote-text">' . $quote_text . '</div>';
echo '<div class="quote-author">' . $quote_author . '</div>';
?>
<?php
if ($post->post_type == 'quote') {
$quote_text = get_the_content();
$author = wp_get_post_terms($post->ID, 'quote_author_tag', array("fields" => "all"));
$quote_author = '<p>— <a href="/quotes/author/' . $author[0]->slug . '">' . $author[0]->name . '</a></p>';
} else {
$quote_text = get_the_content();
$quote_author = get_the_title();
$provider = wp_get_post_terms($post->ID, 'quote_provider_tag', array("fields" => "all"));
switch ($provider[0]->name) {
case 'Proverbia.net':
$quote_text = mb_convert_encoding($quote_text, 'ISO-8859-15', 'UTF-8');
$quote_author = mb_convert_encoding(substr($quote_author, 0, strpos($quote_author, ' &#8211; ')), 'ISO-8859-15', 'UTF-8');
$quote_provider = '<a href="http://es.proverbia.net" target="_blank">' . $provider[0]->name . '</a>';
break;
case 'BrainyQuote':
$quote_provider = '<a href="http://www.brainyquote.com" target="_blank">' . $provider[0]->name . '</a>';
break;
case 'The Quotations Page':
$quote_provider = '<a href="http://www.quotationspage.com" target="_blank">' . $provider[0]->name . '</a>';
}
$quote_text = '<p>' . trim($quote_text, '"') . '</p>';
$quote_author = '<p>— ' . $quote_author . ' (' . $quote_provider . ')</p>';
}
echo '<div class="quote-text">' . $quote_text . '</div>';
echo '<div class="quote-author">' . $quote_author . '</div>';
?>
</li>
<?php endwhile; ?>
</ul><!-- .dpe-flexible-posts -->
<?php
<?php
endif; // End have_posts()
echo $after_widget;