Auto append text after the title?

If I understand you correctly, then the_title hook should help you. You can assign your filter to it and modify the title as you wish: add_filter( ‘the_title’, function( $title, $id ) { return $title . ‘ – Lorem ipsum’; }, 10, 2 );

WooCommerce comments_template Filter Not Firing

Okay, for anyone looking to include the WooCommerce review tab not on an actual single-product page here’s the secret sauce: In your template file, you need: global $withcomments; $withcomments = true; Then add a filter for the comments template: //add filter to use our custom review template add_filter(‘comments_template’,'{{YOUR_HELPER_FUNCTION}}’); /** * Hook function for using custom … Read more

Conditionally including JS based on whether ACF field is set [closed]

The Loop isn’t available yet in wp_enqueue_scripts, so is_single() etc pp aren’t going to work. However, the queried object has already been determined, so you could use something like add_action(“wp_enqueue_scripts”, function() { $qo = get_queried_object(); if(get_class($qo) == “WP_Post”) { if($val = get_field(“my-field”, $qo->ID)) { wp_enqueue_script(“jquery”); } } });

ACF Load Field Groups Programmatically [closed]

In case anyone needs it, this is working for my needs: add_filter(‘acf/get_field_group’, ‘my_change_field_group’); function my_change_field_group($group) { $get_current_screen = get_current_screen(); $get_current_post_type = $get_current_screen->post_type; $my_option = get_field(‘my-option’,’option’); if ( $get_current_post_type == ‘my-cpt’ && $my_option == ‘stuff’ && $group[‘key’] == ‘group_123456789’ ) { $group[‘location’] = array( array( array( ‘param’ => ‘post_type’, ‘operator’ => ‘==’, ‘value’ => ‘my-cpt’, ), … Read more

Filter posts by multiple checkbox categories

I thing, you should use this code for filter the check box category <?php // cat 42=Laos cat 57=2-4Days <?php $my_query_1 = new WP_query(array(‘category__and’ => array(42,57))); ?> <?php while ($my_query_1->have_posts()) : $my_query_1->the_post(); ?> <a href=”https://wordpress.stackexchange.com/questions/100169/<?php the_permalink() ?>” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”><?php the_title(); ?><?php the_excerpt(); ?></a> <?php endwhile; ?>

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