March 14, 2014 at 5:38 pm #237750
I want to setup a blog on my woocommerce site.
When I look at a blog archive page, there is first the listing of my recent articels of the blog and below that I find a column with “Available Pages”
Beside my regular pages I also find the “Thank you” page and “view Order” listet here.
The first one is also setup as an goal in google analytics, so it is not good that this page can be visited via the link there!
Is there a way to tell wp/replete not to display such pages there?
For XML-Sitemaps I found a solution with yoast seo but not for archive pages.
Thanks for guidance
TomMarch 15, 2014 at 9:13 am #237982
Can you provide a link to this archive page? Pages in general shouldn’t ever be showing on post archives with WordPress.
DevinMarch 15, 2014 at 10:40 am #237993
meanwhile I found a workarround and could dissable it.
I found in the themes folder template-archives.php where I dissabled the section between lines 143-163 > “Display pages, categories and month archives”
there are 3 columns generated, the first one is wp_list_pages which is not only listing my “content pages” but also “view order” “thank you page” etc.
is it possible to only remove the woocommerce related pages from this list?
TomMarch 16, 2014 at 7:00 am #238224
On that same line of code, look for this one:
Replace it with:
Replace 3,7,31 with the page id of the pages that you want to exclude.
IsmaelMarch 16, 2014 at 9:18 am #238253
Thank you – that works!
may this goes too far for support, but I found this description in wp codex for wp_list_pages as well:
(string) Only include the Pages that have this Custom Field Key (use in conjunction with the meta_value field).
(string) Only include the Pages that have this Custom Field Value (use in conjunction with the meta_key field).
but I did not find an code example to reverse this function.
I think, it would be very pracitical for me to use a custom key/value pair like key=add2pagelist value=0 (or 1) in a pages custom_fields section and have them excluded programatically in wp_list_pages.
The reason for it is, that I have some pages, like the home page and some pages where I want to do content experiments, which are subject to change frequently or are avaiable in some different versions, so I like to avoid that I have to go always to template-archives.php and exclude/include pages by numbers rahter then doing it directly in the backend on page level.
Hope I wasn’t to unclear with that description?
Thanks for help and suggestions
TomMarch 18, 2014 at 8:26 am #239199
Probably this thread will help you to understand the parameter: http://wordpress.org/support/topic/wp_list_pages-syntax-with-meta_key-038-meta_value-parameters?replies=5
You must be logged in to reply to this topic.