Community Forums › Forums › Archived Forums › Design Tips and Tricks › Adding code to functions or? – WooCommerce and Essentail Grid plugins
Tagged: do_shortcode
- This topic has 7 replies, 2 voices, and was last updated 8 years, 5 months ago by micki.
-
AuthorPosts
-
March 31, 2016 at 3:14 pm #182605mickiParticipant
Hi, It was suggested that I ask theme authors about this. I am getting nowhere with support from Essential Grid plugin guys, Hoping someone may have an answer here.
In order to use the Essential grid "template" on the woo categories pages, I need to add the below code to a child theme file where it starts... while ( have_posts() ) : the_post();
There is nothing like this in the Parallax child. I cannot seem to find it in the Genesis files. They show where to add it as an example for the Twenty Fifteen theme.
I have added it to the functions file but nothing has changed at front end, as in, it is not working. I tried adding it to one of the woo files and uploaded to the correct folder in child theme but that does not work either.
Code:
<?php
// Start the loop.
$my_post_array = array();
while ( have_posts() ) : the_post();/*
* populate array with all queried post IDs
*/
$my_post_array[] = $post->ID;// End the loop.
endwhile;echo do_shortcode( '[ess_grid alias="even_grid_adams" posts='.implode(',', $my_post_array).']' );
Does anyone have a clue as to how I can get this to work?
Thanks in advance!April 1, 2016 at 1:50 am #182630Brad DaltonParticipantApril 1, 2016 at 5:14 pm #182694mickiParticipantthanks so much for the link. I have spent the last hours trying to figure out where to put what, and nothing is working. I installed simple hooks plugin, visual hooks plugin to see correct hooks. I have read and read, and cannot figure this out!
It seems like I would not want to replace the existing loop structure, that will be used on other non woo pages...
I am a bit channglend when it comes to understanding all of this :).
Any other help you can provide is greatly appreciated.
Thank you!
April 1, 2016 at 11:42 pm #182705Brad DaltonParticipantAll you need to do is swap out the shortcode with your own and change the hook.
No need to use a plugin as the code goes in your functions file.
April 6, 2016 at 1:59 pm #183069mickiParticipantStill stumped by this. I tried many things and still cannot get it to work. The instructions that you stated above, what shortcode am I suppose to change out? I tried with the woocommerce_before_shop_loop and genesis_loop, didn't work. I know I am doing something wrong! Anyone out there want a small job???
Thank you!
April 6, 2016 at 7:46 pm #183084Brad DaltonParticipantLink to your site please. Is this a free plugin or premium? How can i download a copy of the plugin for testing?
April 6, 2016 at 8:47 pm #183088mickiParticipantThis reply has been marked as private.April 10, 2016 at 1:47 pm #183304mickiParticipantHi Again,
Now wondering if you can not see posts set to private?
Short answer: Paid plugin. need an activation code and I don't believe it can be used for more then one site. if you would like credentials for the site, let me know.
Thanks!
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.