• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

wpadverts and archive.php

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › wpadverts and archive.php

This topic is: not resolved

Tagged: archive.php, digital pro, wpadverts

  • This topic has 6 replies, 3 voices, and was last updated 8 years, 6 months ago by Brad Dalton.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • August 14, 2017 at 10:12 am #210342
    handsun
    Participant

    Hello! I am just learning php after years of copy/paste answers, so if anyone could bear with me I would greatly appreciate some help. My Classified ads category pages are not displaying and developer says I need to copy from my theme archive.php or taxonomy.php contents and paste into a new file called taxonomy-advert_category.php into the new folder in child theme called wpadverts,
    and add this to functions.php (to force looking into new folder for edits)
    `add_action("init", "my_theme_wpadverts_init", 20);
    function my_theme_wpadverts_init() {
    remove_filter('template_include', 'adverts_template_include');
    }`

    My child theme digital pro does not appear to have an archive or taxonomy.php, but I did find one in genesis and copied that over.

    He said if that does not work, (it did not work) to look for this in the new file
    replace the while(have_posts()) ... endwhile; loop with following code snippet

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

    My problem, I am not sure if I used the correct file (archive.php from genesis) because it does not contain the phrase he mentioned. He said in the next support ticket:
    Hi, sorry i am not sure, i am not familiar with the Genesis themes. If the archive.php file has the_content() call you can try replacing it with the code from WPAdverts documentation, if not then it is possible that the archive.php loads some other file which has the_loop but you would need to ask the theme support about it.

    archive.php does not have the_content() call so I am stuck!

    Included below is a Category url from wpadverts, I have checked it with the url shown in backend, wpadverts category creation and it is correct, but it just loads a Read more, not the ads in that category as it should.

    Any help would be so greatly appreciated!!


    Clean affordable water by Kinetico

    http://www.choresolution.com/advert-category/home-repair-services/
    August 14, 2017 at 10:41 am #210344
    Victor Font
    Moderator

    You're using a 3rd party plugin that is not designed to work with Genesis and are trying to get Genesis templates to work with it. This will never work without customizations of some sort. What those customizations are is impossible to know without diving into code or documentation. The plugin is probably using custom post types that can work with Genesis, but there's no way of knowing at this juncture.

    This is also a problem that will require a lot more effort than can be provided by community volunteers in a free forum. If you have the budget, I suggest you consider hiring a Genesis developer to help you with this.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    August 14, 2017 at 1:08 pm #210351
    handsun
    Participant

    Thank you Victor for your input, I was not really asking for a full development answer, but for advice as to the wpadverts developer's last comment, and to do that I had to lay the scenario out, as I am just learning php, I thought I could have made a big mistake up to this point.

    I will ask support about archives.php, if I can find out if the archive.php loads some other file which has the_loop, since he asked me to find out in Genesis theme support.
    I appreciate your feedback.


    Clean affordable water by Kinetico

    August 14, 2017 at 1:28 pm #210353
    Brad Dalton
    Participant

    I haven't tested this however you may be able to execute your plugins functionality using code like this :

    remove_action( 'genesis_loop', 'genesis_do_loop' );
    add_action( 'genesis_loop', 'add_adverts' ); 
    function add_adverts() {
    
    // Add your code here
    
    }
    

    You can swap out the genesis_loop with any other Genesis hook

    Code can used directly in a template file or conditionally in functions.php


    Tutorials for StudioPress Themes.

    August 14, 2017 at 1:34 pm #210355
    handsun
    Participant

    Thank you Brad, I will give that a try and flex my php muscles!


    Clean affordable water by Kinetico

    August 16, 2017 at 9:19 am #210466
    handsun
    Participant

    That worked, thanks so much Brad, its the same advice Support just sent over, appreciate the help.


    Clean affordable water by Kinetico

    August 16, 2017 at 10:47 am #210468
    Brad Dalton
    Participant

    You're welcome.


    Tutorials for StudioPress Themes.

  • Author
    Posts
Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble