• Hi, I’d like to use the shortcode in the description area of my custom taxonomy archives, but it doesn’t seem to be working there. The shortcode works everywhere else on my site, including on default tag and default category archives.

    To demonstrate, I have created a basic shortcode [featured_image_pro id=’1′] to show a grid of custom taxonomy posts, and placed it in two locations, one in the description section of a default taxonomy (tag) archive (https://dinotoyblog.com/tag/cooperoceras/), and one in the description section of a custom taxonomy archive (https://dinotoyblog.com/classification/ammonite/). But it only works in the default taxonomy archive, nothing appears in the custom taxonomy archive. This seems specific to this plugin since shortcodes for other plugins do work in my custom taxonomy archives.

    Is there a possible explanation and fix for this? Thanks!

    The page I need help with: [log in to see the link]

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author A. Jones

    (@nomadcoder)

    Hello,

    Thank you for letting me know. I will look into this. I seems like it should work.

    Plugin Author A. Jones

    (@nomadcoder)

    Can you try this shortcode on a page? You can make it a private page. I suspect that the query is being overriden.

    Thread Starter dinotoyblog

    (@dinotoyblog)

    Hi, thanks so much for investigating. I’ve tested it on a page (https://dinotoyblog.com/explore/) and a post (https://dinotoyblog.com/stegosaurus-boley-by-gosnell/) and it works on both.

    I did get the dreaded error message “Updating failed. The response is not a valid JSON response.” when updating the page, but it updated nonetheless, and I think this is a separate issue.

    • This reply was modified 9 months, 2 weeks ago by dinotoyblog.
    Plugin Author A. Jones

    (@nomadcoder)

    Great! Thanks. That narrows the issue down. I get that error a lot in the block builder. I don’t know why it happens but I don’t think that it’s related to this plugin.

    Plugin Author A. Jones

    (@nomadcoder)

    I have two quick questions before i proceed. How are you creating your custom archive pages? Are you using a page builder or the theme editor? What theme are you using?

    Thread Starter dinotoyblog

    (@dinotoyblog)

    Hi, I’m using the plugin Simple Taxonomy Refreshed for the custom taxonomies. I use neither page builder or theme editor so I presume this plugin is also responsible for generating the archive pages. I use a child of the theme ‘Basic’ by WP Puzzle.

    Thread Starter dinotoyblog

    (@dinotoyblog)

    Here’s the modified theme code I use in archive.php

     <?php if (is_tax( 'other-category' )) : ?>
     <h1><?php _e( 'Type:', 'basic' ); ?> <?php single_term_title(''); ?></h1>
     <?php elseif (is_tax( 'classification' )) : ?>
     <h1><?php _e( 'Classification:', 'basic' ); ?> <?php single_term_title(''); ?></h1>
     <?php elseif (is_category()) : ?>
     <h1><?php _e( 'Brand:', 'basic' ); ?> <?php single_cat_title(''); ?></h1>
     <?php if ( $not_paged ) echo '<div class="archive-desc">'. category_description() .'</div>'; ?>
     <?php elseif( is_tag() ) : ?>
     <h1><?php _e( 'All', 'basic' ); ?> <em><?php single_tag_title(); ?></em> Reviews</h1>
     <?php if ( $not_paged ) echo '<div class="archive-desc">'. tag_description() .'</div>'; ?>
     <?php elseif (is_day()) : ?>
     <h1><?php _e( 'Day archives:', 'basic' ); ?> <?php the_time('F jS, Y'); ?></h1>
     <?php elseif (is_month()) : ?>
     <h1><?php _e( 'Monthly archives:', 'basic' ); ?> <?php the_time('F, Y'); ?></h1>
     <?php elseif (is_year()) : ?>
     <h1><?php _e( 'Year archives:', 'basic' ); ?> <?php the_time('Y'); ?></h1>
     <?php elseif (is_author()) : ?>
     <h1><?php _e( 'Author:', 'basic' ); ?> <?php the_author(); ?></h1>
     <div class="archive-desc"><?php the_author_meta('description'); ?></div>
     <h1>All reviews by this author</h1>
     <?php elseif (isset($_GET['paged']) && !empty($_GET['paged'])) : ?>
     <h1 class="arhivetitle"><?php _e( 'Archive', 'basic' ); ?></h1>
      <?php endif; ?>
    Plugin Author A. Jones

    (@nomadcoder)

    Thank you!

    Thread Starter dinotoyblog

    (@dinotoyblog)

    Oh, and I also use the plugin ‘Visual Term Description Editor’ to “Replace the plain-text term (category, tag) description editor with a WYSIWYG visual editor.”

    Plugin Author A. Jones

    (@nomadcoder)

    Where are you entering the shortcode? Are you entering the shortcode in the description field of the category? I notice that this plugin doesn’t seem to work in the description field of a custom taxonomy at all.

    Thread Starter dinotoyblog

    (@dinotoyblog)

    You’ve solved it! My archive.php code was missing the get_the_archive_description() for the different custom taxonomies.

    I’ve added that and now the shortcode works. Thank you so much for helping get to the bottom of it, I really appreciate it.

    Edit: yes, I’m adding the code into the description field. It works with the help of the Visual Term Description Editor plugin, which stops the code from being stripped.

    • This reply was modified 9 months, 1 week ago by dinotoyblog.
    • This reply was modified 9 months, 1 week ago by dinotoyblog.
    Plugin Author A. Jones

    (@nomadcoder)

    Great! Thank you for letting me know!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Shortcode not working on custom taxonomy archives’ is closed to new replies.