Community Forums › Forums › Archived Forums › Design Tips and Tricks › wpadverts and archive.php
Tagged: archive.php, digital pro, wpadverts
- This topic has 6 replies, 3 voices, and was last updated 6 years, 8 months ago by Brad Dalton.
-
AuthorPosts
-
August 14, 2017 at 10:12 am #210342handsunParticipant
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 thewhile(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!!
http://www.choresolution.com/advert-category/home-repair-services/August 14, 2017 at 10:41 am #210344Victor FontModeratorYou'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 #210351handsunParticipantThank 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.
August 14, 2017 at 1:28 pm #210353Brad DaltonParticipantI 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
August 14, 2017 at 1:34 pm #210355handsunParticipantAugust 16, 2017 at 9:19 am #210466handsunParticipantThat worked, thanks so much Brad, its the same advice Support just sent over, appreciate the help.
August 16, 2017 at 10:47 am #210468Brad DaltonParticipant -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.