Change Woocommerce order button page on particular page

You can try the following add_filter( ‘woocommerce_order_button_text’, ‘woo_custom_order_button_text’, 999 ); function woo_custom_order_button_text() { if( is_page(37802)) { // only run if page ID is 37802 return __( ‘Join The Retreat’, ‘woocommerce’ ); } return __( ‘Join The Founders Circle’, ‘woocommerce’ ); } UPDATE The conditional logic is_page() does not work. WHY Because on the checkout page, … Read more

How can I detect hierarchal relationships beyond children (grandchild, great-grandchild, etc)?

Turns out there is an excellent function that has been passed around the WordPress forums is_tree() function is_tree($pid) { // $pid = The ID of the page we’re looking for pages underneath global $post; // load details about this page $anc = get_post_ancestors( $post->ID ); foreach($anc as $ancestor) { if(is_page() && $ancestor == $pid) { … Read more

Conditional Shortcode image display

I wasn’t able to replicate your problem exactly, but here’s a tip: include some default behavior, in case the user puts in a bad value for the subject: // Set image acorring to guide type if ($subject == ‘wordpress’) { $subjectImg = ‘<img src=”‘.get_bloginfo(‘template_url’).’/img/postInfoBox/wordpress.png” alt=”מדריך וורדפרס” />’; } elseif ($subject == ‘web design’) { $subjectImg … Read more

Plugin Code ONLY on Post Edit Page

Using @One Trick Pony’s method, this should do what you want: global $current_screen; // Makes the $current_screen object available if ($current_screen && $current_screen->base == “edit”) { // Edit-page/post-only code here } If you want it on the add OR edit screens, then: global $current_screen; // Makes the $current_screen object available if ($current_screen && ($current_screen->base == … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)