Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #237750

    Hi,

    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
    Tom

    #237982

    Hey Tom!

    Can you provide a link to this archive page? Pages in general shouldn’t ever be showing on post archives with WordPress.

    Regards,
    Devin

    #237993

    Hi Devin,

    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?

    Thank you
    Tom

    #238224

    Hey!

    On that same line of code, look for this one:

    wp_list_pages('title_li=&depth=-1' );
    

    Replace it with:

    wp_list_pages('title_li=&depth=-1&exclude=3,7,31' );
    

    Replace 3,7,31 with the page id of the pages that you want to exclude.

    Best regards,
    Ismael

    #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:
    meta_key
    (string) Only include the Pages that have this Custom Field Key (use in conjunction with the meta_value field).
    meta_value
    (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
    Tom

    #239199

    Hey!

    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

    Best regards,
    Peter

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.