Support » Plugin: WordPress Infinite Scroll - Ajax Load More » List posts by starting letter

  • Hey there,

    I want to add a page to my blog where I can select a letter (tabbed navigation, complete alphabet), and depending on which tab (letter) is selected, I want to list all posts where the title is starting with this letter (I’d also like to include this in a meta query on a custom attribute).
    So far I’ve seen your meta query supports different methods like =, >= or LIKE.
    Unfortunately I can’t use the LIKE attribute, cause wordpress is automatically adding placeholder % to the start and the end of the search key (i’d like it to be only “term%”).
    After a bit of googling, I found this article http://wordpress.stackexchange.com/questions/159426/meta-query-with-string-starting-like-pattern.
    The people over there are talking about a REGEXP comparator (added in wordpress >=3.7), it seems that I would be able to achieve what I want if I could use this.

    Is it possible to add this REGEXP comparator to your plugin, or do you have another idea how I could achieve this?

    Any help would be much appreciated, I love your plugin.
    Thanks in advance!

    https://wordpress.org/plugins/ajax-load-more/

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

    (@dcooney)

    Hi TheExoduser,
    Have you tried manually adding ‘REGEXP’ as the compare param?

    [ajax_load_more meta_key="email" meta_value="^hello@" meta_compare="REGEXP"]

    Let me know?

    Hi dcooney
    I’ve created a list of letters

    <?php 
    $aToZ = range( 'a', 'z' );
    echo '<ul class="aToZ-list list-unstyled">';
    foreach ( $aToZ as $char )
    echo "<li><a href='?cognome=" . $char . "' title='". $char ."'>" . $char ." </a></li>";
    echo '</ul>';
    ?>

    How do plug-in filters work?
    Thanks

    Plugin Author Darren Cooney

    (@dcooney)

    Hi @websim,
    Do you have your custom fields or function set up to allow for this type of query?

    Out of the box WordPress will not query by skits starting letter.

    Hi dcooney
    I did not create any functions, the code was just an example.
    I want know how integrate your plugin with my filter.
    This is possible?
    Can you give me some indication?

    Thanks

    Plugin Author Darren Cooney

    (@dcooney)

    You could use the built in filtering of Ajax Load More.
    https://connekthq.com/plugins/ajax-load-more/examples/filtering/

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘List posts by starting letter’ is closed to new replies.