do_shortcode doesn’t work on some category pages
-
Hello,
thank you for great plugin. Unfortunatelly I have found one issue, which I am not able to solve. Could you please help me?
I am using custom category.php in my Twenty Fifteen for displaying 3 different categories of my web. On two of them it works ok. Ads are showing as expected on widget part of page and the top add with <?php echo do_shortcode(‘[quads id=2]’); ?>.
On the page https://marteen.cz/novinky-na-webu/ it doesn’t work at all. No ads at all. I have no idea what is wrong. Any idea?
Thank you.
Source code of https://marteen.cz/novinky-na-webu/:
<?php
/**
* The template for displaying archive pages
*
* Used to display archive-type pages if nothing more specific matches a query.
* For example, puts together date-based pages if no date.php file exists.
*
* If you’d like to further customize these archive views, you may create a
* new template file for each one. For example, tag.php (Tag archives),
* category.php (Category archives), author.php (Author archives), etc.
*
* @link https://developer.ww.wp.xz.cn/themes/basics/template-hierarchy/
*
* @package WordPress
* @subpackage Twenty_Fifteen
* @since Twenty Fifteen 1.0
*/get_header(); ?>
<section id=”primary” class=”content-area”>
<main id=”main” class=”site-main” role=”main”><header class=”page-header”>
<?php
add_filter( ‘get_the_archive_title’, the_archive_title( ‘<h1 class=”page-title”>’, ‘</h1>’ ));
the_archive_description( ‘<div class=”taxonomy-description”>’, ‘</div>’ );
?>
</header><!– .page-header –>
<div class=”entry-content”>
<?php echo do_shortcode(‘[quads id=2]’); ?>
<p>
<?php
if ( in_category(‘nove-eroticke-povidky’) ) {
echo do_shortcode( ‘[the-post-grid id=”250″ title=”Výpis všech nových povídek”]’ );
echo ‘<p>Nevybrali jste si? Zkuste mé staré erotické povídky…</p>’;
} elseif ( in_category(‘stare-eroticke-povidky’) ) {
echo do_shortcode( ‘[the-post-grid id=”239″ title=”Výpis všech starých povídek”]’ );
echo ‘<p>Nevybrali jste si? Zkuste mé nové erotické povídky…</p>’;
} elseif ( in_category(‘novinky-na-webu’) ) {
echo do_shortcode( ‘[the-post-grid id=”258″ title=”Výpis všech novinek”]’ );
} else {
echo ‘Nedefinovaná kategorie!’;
}
?>
</p>
<p>Marteen Macc – erotické povídky / Nové erotické povídky / Staré erotické povídky / Erotické povídky dle tématiky / Nejčtenější erotické povídky / Erotické e-knihy / Novinky na webu / Sexshop / Kdo jsem / Napište nám</p></div>
</main><!– .site-main –>
</section><!– .content-area –>
<?php get_footer(); ?>The page I need help with: [log in to see the link]
The topic ‘do_shortcode doesn’t work on some category pages’ is closed to new replies.