• Hi Darren,

    When the REST API is used instead of the repeater template & the repeater template is left empty,

    A   is injected randomly into the page markup leaving a white space

    I instead placed an opening php tag:

    <?php

    This would at least output an empty p tag:

    <p class=””></p>

    For some reason an empty class is also created. In the short term I was able to hide the p tag using the CSS below from chaining a parent main div.

    .main>p:first-child {
    display: none;
    }

    In short, when the template is left empty or unused and the REST API is used instead, is there a way to remove the &nbsp; or p tag being output?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Darren Cooney

    (@dcooney)

    @markifornia I’m not sure. It’s likely the_content hook or something.

    What’s the use case using an empty template?

    Thread Starter markifornia

    (@markifornia)

    Hi Darren,

    The use case is using the REST API instead of the default Repeater Template,

    The REST API mustache template is used instead, so the PHP repeater template would no longer be in use, in this case it would be left empty.

    When it’s left empty though, a &nbsp; or a <p> tag is output which causes an unintended whitespace on the webpage.

    Is there are the_content hook I can directly place within the default PHP template (or functions.php) which would remove any outputted strings within the repeater template? Open to any workarounds you may know of.

    Thanks
    Mark



    Plugin Author Darren Cooney

    (@dcooney)

    Are you using the REST API extension? If so, you should be using Repeater Templates with Mustache templates.

    https://connekthq.com/plugins/ajax-load-more/extensions/rest-api/

    Thread Starter markifornia

    (@markifornia)

    Yes that is what I’m using the repeater templates with Mustache using the REST API.

    But the default repeater template (which is empty) keeps outputting a &nbsp; or a an empty p tag.

    I tried outputting something like:

    <p style=”display: none;”></p>

    To override the output from the default repeater template but is has no effect.

    Plugin Author Darren Cooney

    (@dcooney)

    Sorry, I’m having trouble following what the issue is.

    Where are you outputting the Default Repeater Template?

    Thread Starter markifornia

    (@markifornia)

    Hey Darren – apologies here, we found that the weird white spacing issue is caused by something else it seems, I am going to look into this further. I will provide an update once I fully confirm.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘  and empty p tag being output when template is empty and REST API is used’ is closed to new replies.