Site logo

Archived topic

Standard pager for *pages*

5 replies · Started by nudnavda on January 25, 2023

Viewing posts 1–6 of 6

Hi,
unlike the inbuilt navigation for posts - and the beautiful navigation element templates - I cannot find any solution for a dynamic page-title navigation.
Does this necessarily require a plugin? The pager-plugin seems to be no qualified block: cannot use its widget in an element.
Thanks for your help.

Hi there,

can you share a link to the pager plugin so i have some reference as to what you require ?

OK, so that plugin if it requires a widget area, then you could add this PHP snippet to your site:

function db_menu_bar_items_widget_area() {

	register_sidebar( array(
		'name'          => 'After Content Widget',
		'id'            => 'after_content_widget',
		'before_widget' => '<div>',
		'after_widget'  => '</div>',
	) );

}
add_action( 'widgets_init', 'db_menu_bar_items_widget_area' );

add_action('generate_after_content', function(){
	if ( is_active_sidebar( 'after_content_widget' ) && is_page() ) : ?>
		<div id="primary-sidebar" class="menu-sidebar widget-area" role="complementary">
			<?php dynamic_sidebar( 'after_content_widget' ); ?>
		</div>
	<?php endif;
});

It will create a Widget Area after the Content on all pages, called: After Content Widget

Then you can try adding that plugins widget there.

Let me know.

Thanks, David - works!

Awesome - glad to hear that!

This archived topic is closed to new replies.