Using WordPress functions on other sites

You could simply include the WordPress main file that it loads, wp-load.php or wp-blog-header.php at the very top of your forum’s header file. If I’m correct, that should allow you to use WordPress functions inside your forum theme. Example, at the top of your header, assuming the forum folder is in the root WP folder: … Read more

pagination in woocommerce order history page

I have added pagination in order history page and it is working. Replace below code above loop $customer_orders1 = get_posts(apply_filters(‘woocommerce_my_account_my_orders_query’, array( ‘numberposts’ => -1, ‘meta_key’ => ‘_customer_user’, ‘meta_value’ => get_current_user_id(), ‘post_type’ => wc_get_order_types(‘view-orders’), ‘post_status’ => array_keys(wc_get_order_statuses()) ))); $total_records = count($customer_orders1); $posts_per_page = 20; $total_pages = ceil($total_records / $posts_per_page); $paged = ( get_query_var(‘page’) ) ? get_query_var(‘page’) … Read more

How-to inspect filter-able $vars?

Example Nav menu walker – allows adding eg. css classes to (all) menu items. // copyied from /wp-core/wp-includes/nav-menu-template.php > line 76 (wp 3.1.1) – start_el() function $class_names = join( ‘ ‘, apply_filters( ‘nav_menu_css_class’, array_filter( $classes ), $item, $args ) ); Now let’s check the $var: function wpse15319_check_nav_menu_classes( $classes ) { // You can take any … Read more

TinyMCE style_select – Append Classes

EDIT The quick and easy method is just a simple setting: style_formats_merge… function myformatTinyMCE($in) { $style_formats = array( array( ‘title’ => ‘Classes’, ‘items’ => array( array( ‘title’ => ‘Blue Color’, ‘selector’ => ‘p,strong,u,em,ol,ul’, ‘classes’ => ‘blueColor’ ) ) ) ); $in[‘style_formats_merge’] = true; $in[‘style_formats’] = json_encode( $style_formats ); return $in; } add_filter(‘tiny_mce_before_init’, ‘myformatTinyMCE’ ); Everything … Read more