Inicio - Documentación - POM Theme - 11 Developers - Use button and pagination helpers

Use button and pagination helpers

Button styles

Helper Purpose
pom_get_button_styles() Return the normalized button styles available to rendering code
pom_get_custom_button_styles( $action = '' ) Return custom/named styles in the requested public form
pom_get_button_font_options() Return font options accepted by button configuration
pom_get_button_font_weight_icon_options() Return weight/icon options
pom_build_button_style( array $data, bool $is_default = false, int $index = 1 ) Normalize one style definition
pom_get_button_trbl_array( $value, ... ) Normalize top/right/bottom/left values

Public content normally references a configured style through web-btn and web-btn-{slug}. Keep the style slug stable after pages/templates use it.

For links styled as buttons, retain link semantics. Use a real <button> only for an action that does not navigate. Include visible/focus states and do not rely on color alone.

Pagination

pom_get_pagination( WP_Query $query, string $align = 'center', bool $return = false );

Pass the exact query whose paging state you are presenting. With $return = true, capture the markup; otherwise the helper prints it.

$pagination = pom_get_pagination( $query, 'center', true );
echo $pagination; // Trusted markup from the POM renderer.

Other specialized helpers include:

  • pom_get_pagination_ajax( $query, $template, $current_page = 0 );
  • pom_get_load_more_button( $query, $template, $text = '', $button_style = 1, $return = false, $display_button = true ).

Do not attach these to an unrelated global query. AJAX pagination also needs the same query/template contract on subsequent requests, capability-safe inputs and duplicate-click protection.

Performance

Pagination does not make an unbounded query cheap if code has already loaded every item. Set a reasonable page size, avoid unnecessary meta/term caches and keep the selected result template's data needs narrow.