Skip to content

Instantly share code, notes, and snippets.

@dcooney
Last active November 9, 2022 16:31
Show Gist options
  • Select an option

  • Save dcooney/31c61a40a1591bdba5e8b9b512ac9b9d to your computer and use it in GitHub Desktop.

Select an option

Save dcooney/31c61a40a1591bdba5e8b9b512ac9b9d to your computer and use it in GitHub Desktop.

Revisions

  1. dcooney revised this gist Nov 9, 2022. 1 changed file with 9 additions and 1 deletion.
    10 changes: 9 additions & 1 deletion André.php
    Original file line number Diff line number Diff line change
    @@ -3,4 +3,12 @@
    if ( ! empty( $categories ) ) {
    $current_cat = esc_html( $categories[0]->name );
    }
    echo do_shortcode('[ajax_load_more single_post="true" single_post_id="'. get_the_ID() .'" single_post_target=".type-post" post_type="post" single_post_order="query" category="' . $current_cat .'" pause_override="true"]'); ?>
    echo do_shortcode('[ajax_load_more single_post="true" single_post_id="'. get_the_ID() .'" single_post_target=".type-post" post_type="post" single_post_order="query" category="' . $current_cat . '" pause_override="true"]'); ?>


    OR

    <?php
    echo do_shortcode('[ajax_load_more single_post="true" single_post_id="'. get_the_ID() .'" single_post_target=".type-post" post_type="post" single_post_order="query" taxonomy="category" taxonomy_terms="' . $current_cat . '" taxonomy_operator="IN" pause_override="true"]'); ?>

    ?>
  2. dcooney created this gist Nov 9, 2022.
    6 changes: 6 additions & 0 deletions André.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    <?php
    $categories = get_the_category();
    if ( ! empty( $categories ) ) {
    $current_cat = esc_html( $categories[0]->name );
    }
    echo do_shortcode('[ajax_load_more single_post="true" single_post_id="'. get_the_ID() .'" single_post_target=".type-post" post_type="post" single_post_order="query" category="' . $current_cat .'" pause_override="true"]'); ?>