probleme adding Txt and Links in preg_match()

Finally a solution provide by @Rizier123 if(!preg_match(“https://wordpress.stackexchange.com/” . preg_quote($citation_string, “https://wordpress.stackexchange.com/”) . “https://wordpress.stackexchange.com/”, $footer_contents)) @Rizier123 say : The problem are the slashes in your pattern, just use preg_quote() to escape them, e.g. so the code will be like this : add_action(‘template_redirect’, ‘foobar_explode_if_no_citation’); function foobar_explode_if_no_citation(){ #Get the absolute server path to footer.php $footer_path = locate_template(‘footer.php’); #Store the … Read more

WooCommerce – Customer Order History Pagination

I have added pagination in order history page and it is working. Replace below code above loop $my_orders_columns = apply_filters( ‘woocommerce_my_account_my_orders_columns’, array( ‘order-number’ => __( ‘ID’, ‘woocommerce’ ), ‘order-date’ => __( ‘Date’, ‘woocommerce’ ), ‘order-total’ => __( ‘Packages’, ‘woocommerce’ ), ‘order-total’ => __( ‘Price’, ‘woocommerce’ ), ‘order-status’ => __( ‘Status’, ‘woocommerce’ ), ‘order-actions’ => ‘ ’, … Read more

WordPress widget in custom theme

You have to hook your widget registering like that: add_action(“widgets_init”, “register_widgets”);// Hook WP /** * Register widgets */ function register_widgets() { require_once “FooWidget.php”; register_widget(“FooWidget”); } Same for the widget zones add_action(“widgets_init”, “register_widgets_zones”); function register_widgets_zones() { register_sidebar(array( “name” => “Foo Zone Page”, “id” => “foo-zone-widgets”, “class” => “panel”, “before_widget” => ‘<div id=”%1$s” class=”widget %2$s”>’, “after_widget” => … Read more

Blank on static home page?

From the Codex If you are using a custom homepage with custom loops and stuff or a custom front-page, you will have an empty wp_title. Here goes a neat hack to add the description/tagline at the wp_title place on homepage: add_filter( ‘wp_title’, ‘baw_hack_wp_title_for_home’ ); function baw_hack_wp_title_for_home( $title ) { if( empty( $title ) && ( … Read more

Check if Favicon is set in Customizer

WordPress saves the Favicon as site_icon in the options table holding the attachment post ID. What you could do is something like this: if( false === get_option( ‘site_icon’, false ) ) { // Show favicon } Where get_option() will hit the default ( we provide as the 2nd parameter ) false IF the site_icon does … Read more