feat: add content feed with AJAX filtering and load more on front page

This commit is contained in:
2026-04-03 01:13:09 +05:00
parent 82105c6f09
commit 8f1f001085
7 changed files with 484 additions and 1 deletions
+21 -1
View File
@@ -16,13 +16,33 @@ add_action( 'wp_enqueue_scripts', 'bitwms_enqueue_scripts', 20 );
function bitwms_enqueue_scripts() {
$theme_version = wp_get_theme()->get( 'Version' );
$theme_uri = get_stylesheet_directory_uri();
// Sidebar navigation — loaded in footer (5th arg: true).
wp_enqueue_script(
'bitwms-sidebar-nav',
get_stylesheet_directory_uri() . '/js/sidebar-nav.js',
$theme_uri . '/js/sidebar-nav.js',
array(), // no dependencies
$theme_version,
true // load in footer
);
// Content feed AJAX filter — front page only.
if ( is_front_page() ) {
wp_enqueue_script(
'bitwms-ajax-filter',
$theme_uri . '/js/ajax-filter.js',
array(),
$theme_version,
true
);
wp_localize_script(
'bitwms-ajax-filter',
'bitwmsAjax',
array(
'url' => admin_url( 'admin-ajax.php' ),
'nonce' => wp_create_nonce( 'bitwms_filter_nonce' ),
)
);
}
}