Remove conditional tag from header

You need to create a child theme. You can use a plugin to do that, just search for ‘child theme’ on the wordpress plugins search. After that, you need to copy your header.php to the child theme directory. Then, you need to change the code above to the following: <?php if ( get_bloginfo( ‘description’ ) … Read more

Can this code be concatenated?

this is more a PHP question you can try these folowing forms : if (…) { echo ‘<p>’; get_template_part(‘templates/xxx’); echo ‘</p>’; } or if (…) { ?> <p> <?php get_template_part(‘templates/xxx’); ?> </p> <?php }

Gravity Forms, multiple conditions in shortcode

You can nest the singular and plural versions of the shortcode: [gravityforms action=”conditional” merge_tag=”{:3}” condition=”greater_than” value=”10″] [gravityform action=”conditional” merge_tag=”{:3}” condition=”less_than” value=”30″]Your value is greater than 10 less than 30[/gravityforms] [/gravityforms] More details on that here: https://gravitywiz.com/gravity-forms-conditional-shortcode/ – OR – You can use this snippet to create multiple conditions in a single shortcode: https://gist.github.com/spivurno/9db18385ed1d1f11a897bdfa8a1f2007 [gravityforms action=”conditional” … Read more

Additional conditions tags to work

Count the brackets, you’ve got an extra one: // ↓ here if ( is_user_logged_in() & !is_admin() ) & !is_page(‘account’) ) { Also, you should use double ampersands in conditions like this. So: if ( is_user_logged_in() && !is_admin() && !is_page(‘account’) ) {

Undefined index for default custom theme option

You could make sure the index is defined before accessing it in header.php, and fallback gracefully: <?php $theme_option = flagship_sub_get_global_options(); if ( array_key_exists( ‘flagship_sub_shield’, $theme_option ) ) { $shield = $theme_option[‘flagship_sub_shield’]; } else { $shield = ‘option1’; // Default value } if (‘option2’ === $shield): //Image Option #2 elseif (‘option3’ === $shield): //Image Option #3 … Read more

Alt Image WordPress [closed]

Unless your theme uses some type of hook to add the logo, there is probably not a solution in functions.php. Your best bet is to look through the different PHP files in your theme to figure out where the logo is being added with no alt text. From there, ideally you would check to see … Read more

Changing Post Tag Color Based On Post Count

Here you go. I just added a class using $tag->count. Tested and works. <div class=”container”> <?php $tags = get_tags(array( ‘hide_empty’ => false, ‘count’ => true )); foreach ($tags as $tag) :?> <a class=”count-<?php echo $tag->count; ?>” href=”https://wordpress.stackexchange.com/questions/324587/<?php echo esc_url( get_tag_link( $tag->term_id ) ); ?>” title=”<?php echo esc_attr( $tag->name ); ?>”><?php echo esc_html( $tag->name ); ?></a> … Read more

why str_replace targeting pages instead just targeting post?

Your code is returning $text only for posts and nothing for other post types like pages. Your function should be like this add_filter(‘the_content’, ‘replace_word’); function replace_word($text) { if (is_singular( ‘post’ )){ $text = str_replace(‘dog’, ‘cat’, $text); return $text; } // you must return content for pages/ other post types return $text; }

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