Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Your theme seems to be using a different template for taxonomies than for pages, the easiest way to fix that is to use this code snippet https://github.com/simpliko/wpadverts-snippets/blob/master/alt-term-links/alt-term-links.php

    More complicated method would be to go to your current theme directory, create there file named taxonomy-advert_category.php file copy to it content from single.php or page.php file and replace <?php the_content() ?> with

    
    <?php
    global $wp_query;
    echo shortcode_adverts_list(array(
        "category" => $wp_query->get_queried_object_id()
    ));
    ?>
    

    This should work with most of the themes, if it will not work with yours you can ask your theme support how to make the custom taxonomy use the page.php template file.

    Thread Starter exodor

    (@exodor)

    1. What should I do with the code on GitHub? where should I place it?
    2. I tried the second option. Where should I place this:
    <?php
    global $wp_query;
    echo shortcode_adverts_list(array(
    “category” => $wp_query->get_queried_object_id()
    ));
    ?>

    over there?
    <?php
    global $wp_query;
    remove_filter(“the_content”, “adverts_the_content”);
    echo shortcode_adverts_list(array(
    “category” => $wp_query->get_queried_object_id()
    ));
    ?>

    Plugin Author Greg Winiarski

    (@gwin)

    1. The code you can paste into your theme functions.php file, but it is much better to copy the PHP files and use them as separate plugins, then the changes will not be overwritten on theme update.

    How to use the snippets as plugins is explained here at the bottom https://github.com/simpliko/wpadverts-snippets

    2. you first need to create in your theme a file named taxonomy-advert_category.php and copy to it content from taxonomy.php or archive.php then paste the code in place of <?php the_content() ?> there are unfortunately no exact steps how to do that as each theme is differently coded, some of the authors are using their own frameworks in which case the method #1 might be the only option (aside of asking theme author how to create a custom taxonomy template for their theme).

    Thread Starter exodor

    (@exodor)

    Ok…I tried everything, I activated the plugin “alt-term-links.php”but still the categories results are placed to the far left of the screen and not in the center….Can you help some more?

    Thread Starter exodor

    (@exodor)

    I figured it out. I deleted:
    .adverts-field-name-advert_category {
    overflow: visible !important;
    }
    from my Customise CSS file

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Categories shows awkward’ is closed to new replies.