• Resolved Andrew Leonard

    (@andrewleonard)


    When the FAQ page is not defined in Settings and when the content being viewed is not a Post, this expression is true and the [ultimate-faqs] shortcode is expanded

    if ( $post->ID == $this->settings->get_setting( 'faq-page' ) ) {

    In my site, this prevents the Events Calendar plugin displaying its archive page

    The work-around is to define the “FAQ” page in FAQS>Settings>Basic>General

    The fix is to add the following code before the above expression:

    if ( 0 === $post->ID ) {
        return $content;
          }
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support jaysupport

    (@jaysupport)

    Hi Andrew,

    Do you have FAQs in a widget in your sidebar? In other words, are you trying to display FAQs on the Events Calendar archive page? I ask because I’d like to know if this is only happening on pages where there is supposed to be some FAQ output.

    If not, are FAQs nevertheless being returned/output on the Events Calendar archive page? Either way, could you provide a link to that page, so we could inspect the source code?

    Does this happen only for that specific post type or taxonomy? (i.e. If you go to the archive page for a certain category for the regular posts on your site, do you get the same issue?)

    • This reply was modified 2 years, 6 months ago by jaysupport.
    Thread Starter Andrew Leonard

    (@andrewleonard)

    This is the meetings page: https://ebps.org.uk/events/
    This is the FAQ page: https://ebps.org.uk/website/faq/
    I am not using the FAQ widget
    I am not trying to display FAQs on the Events Calendar archive page

    You will not see the error because I have set FAQs Page to “FAQ”

    If you want to see the error on ebps.org.uk we will have to liase a short time where I can remove the entry from the FAQs Page

    As far as I can tell it only effects the Events Calendar archive

    Thread Starter Andrew Leonard

    (@andrewleonard)

    You can see it going wrong here: https://dev.ebps.org.uk/?post_type=tribe_events

    This is the development version of our website. It may not be setup quite correctly as the URLs may point to the production website,if you click on links, but if you make sure the URL is dev.ebps.org.uk, you can see the problem

    Thread Starter Andrew Leonard

    (@andrewleonard)

    The problem occurs with the events calendar plugin on the URL that the events calendar uses to display its archive. It doesn’t occur on normal archive pages since the global $post object is set.

    Thread Starter Andrew Leonard

    (@andrewleonard)

    If you go here: https://dev.ebps.org.uk/event/committee-nhm/
    and then click on the first FAQ: Buying stuff
    You will see your FAQ and then our event…

    Plugin Support jaysupport

    (@jaysupport)

    Hi Andrew,

    Thanks for sharing that.

    We installed the events calendar plugin on our demo site and the FAQs have no conflict with it, regardless of whether or not something is specified for the FAQ Page setting.

    You can see this here:

    https://www.etoilewebdesign.com/ultimate-faq-demo/event/test-event/

    https://www.etoilewebdesign.com/ultimate-faq-demo/events/

    That site is on the latest version of both the FAQ and the events calendar plugins and does not have anything set for the FAQ Page setting.

    Nevertheless, even though, with the way that option is set up, it shouldn’t happen, it is possible for an undefined value to return true for the condition we use to set the FAQ page. With that in mind, what happens on your site if you change the condition to the following more strict one?

    if ( $this->settings->get_setting( 'faq-page' ) === $post->ID )

    • This reply was modified 2 years, 6 months ago by jaysupport.
    Thread Starter Andrew Leonard

    (@andrewleonard)

    That fix also works for us

    I do not understand why you cannot reproduce our problem
    When I “inspected” the FAQS>Settings>Basic>General>FAQs Page
    This is an extract of what I see:
    It only goes “wrong” if I select the first “blank” option – it works OK if I chose any of the next 7 “blank” options. The first option returns a null, whereas the other options return an integer value

    <select name="ewd-ufaq-settings[faq-page]" id="ewd-ufaq-settings[faq-page]" control-id="ControlID-2">
    
    									<option></option>
    				
    									<option value="30353"></option>
    									<option value="31206"></option>
    									<option value="32567"></option>
    									<option value="36337"></option>
    									<option value="2147"></option>
    									<option value="10170"></option>
    									<option value="10316"></option>
    									<option value="5159">!Annoying Man</option>
    									
    				
    			</select>
    Plugin Support jaysupport

    (@jaysupport)

    Don’t know. It doesn’t happen on our demo site or any of our test installs we use. We’ve also never had a report of this from anyone else.

    Glad that the updated condition works for you. We’ll test it out to see if we can update the condition to that or something similar in one of the next releases.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘add_faqs_content method overrides archives when FAQ Page not set’ is closed to new replies.