Change a url / link if a user is logged in?

Change the line with the URL: <a href=”https://wordpress.stackexchange.com/questions/70644/<?php echo get_option(“home’); ?>/”><div id=”logo”> … and check if the user is logged in: <a href=”https://wordpress.stackexchange.com/questions/70644/<?php if ( is_user_logged_in() ) { echo admin_url(“/themes.php?page=wptuts-settings’ ); } else { echo home_url( “https://wordpress.stackexchange.com/” ); } ?>/”><div id=”logo”> And echo get_option(‘home’); is not correct. See wp-includes/link-template.php:home_url() to understand why the real home … Read more

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

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

Personalized message for each unique password-protected page

You should probably add in more checks, but this should get you started. function change_pw_text($content) { // Just to save processing other pages. if ( !is_page(‘page-slug-one’) && !is_page(‘page-slug-two’) ) return $content; $find = ‘This post is password protected. To view it please enter your password below:’; if ( is_page(‘page-slug-one’) ) $replace=”Hint: Tell our system to … Read more

wordpress is_page() problem

You probably want to drop the conditional during init. You are just registering the script here, not enqueueing it. Once registered, you should be able to call the script later in the action sequence. Please try something like this: function myplugin_css() { if ( is_page( ‘myinfopage’ ) ) { wp_enqueue_script( ‘RGraph’ ); } } add_action( … Read more

Conditional Statement – Best Way to Remove Nav on Contact Page

You could try putting this code in your functions.php function remove_contact_nav( $nav_menu, $args ){ if( is_page_template(‘template-contact.php’) || is_page( ‘contact’ ) ) { $nav_menu = null; } return $nav_menu; } add_filter( ‘wp_nav_menu’, ‘remove_contact_nav’, 11, 2 ); The if condition need to be modified as per your template name or the second condition would also do if … Read more

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