Saturday, December 3, 2022
HomeWordPress DevelopmentPresent customized class archive as entrance web page and take away taxonomy...

Present customized class archive as entrance web page and take away taxonomy slug from urls


I’ve an artwork portfolio website in improvement.

I’ve used CPT UI to arrange:
submit kind: works
taxonomy: mediums
mediums: work, and many others

One of the best ways I may suppose to set this up was to make use of taxonomy-medium.php because the archive/template for displaying these customized posts.

That is working advantageous with the next code:

<?php if ($posts) : ?>
    <!-- Slider essential container -->
    <div class="swiper mySwiper">
        <!-- Further required wrapper -->
        <div class="swiper-wrapper">
            <!-- Slides -->
            <?php foreach ($posts as $submit) :
                setup_postdata($submit) ?>
                <div class="swiper-slide"><?php the_content(); ?></div>
            <?php endforeach; ?>
        </div>
    </div>


    <!-- If we'd like pagination -->
    <div class="swiper-pagination"></div>

    <!-- If we'd like navigation buttons -->
    <div class="swiper-button-prev"></div>
    <div class="swiper-button-next"></div>

<?php wp_reset_postdata(); ?>

<?php endif; ?>

Now I need to clear up the UI by doing 2 issues.
First, I wish to take away the customized taxonomy slug from urls, altering it from
https://website.dev/medium/work to https://website.dev/work
I’ve tried a number of plugins that declare to do that and none labored.

Subsequent I wish to forego a touchdown web page, and simply have https://website.dev/work because the entrance web page, displaying the content material from the archive web page code proven above.

I’ve seemed by means of many solutions to each these questions, and haven’t been capable of finding a working answer. If I set a web page with:

<?php locate_template( 'taxonomy-medium.php', TRUE, TRUE ); ?>

it masses the slider however returns no posts. Ideally I might additionally like the house url to redirect to https://website.dev/work in order that clicking on menu merchandise work reveals the identical url.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments