WordPress.org

Forums

Default archives query to shortcode (1 post)

  1. LapanWebsite
    Member
    Posted 1 year ago #

    What's query / default query for WordPress archives that I can put in functions and call it by shortcode:

    <?php do_shortcode('[archives]'); ?>

    inside archive.php

    Found get_queried_object();, I don't know is it right function.

    Instead of

    <?php while ( have_posts() ) : the_post(); ?>
    <h1 class="entry-title"><?php the_title(); ?></h1>
    <div class="entry-content">
    <?php the_content(); ?>
    /* Custom Archives Functions Go Below this line */
    
    /* Custom Archives Functions Go Above this line */
    </div><!-- .entry-content -->
    <?php endwhile; // end of the loop. ?>

    I want to call it by

    <?php do_shortcode('[archives]'); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.