Add text/link next to the last word of each post

If your site or post type doesn’t use Gutenberg, this is likely because of the wpautop function: it is applied with priority 10 on the_content filter, so the paragraph tags have already been added by the time your filter is running. Changing your callback’s priority to be less than 10 will likely solve your issue. … Read more

How can I strip a single tag from an email post

The following regex should do the trick to select all instances of the videopack shortcode, including contents: \[videopack.*?\[\/videopack\] $post_description = preg_replace( ‘\[videopack.*?\[\/videopack\]’, ”, $post->post_content ); https://www.php.net/manual/en/function.preg-replace.php https://regexr.com/

SQL phpmyadmin remove posts from cat id exclude condition

finally I find right code with helping by ChatGPT DELETE p FROM wp_posts p INNER JOIN wp_term_relationships tr1 ON (p.ID = tr1.object_id AND tr1.term_taxonomy_id = 2) LEFT JOIN wp_term_relationships tr2 ON (p.ID = tr2.object_id AND tr2.term_taxonomy_id = 20) WHERE p.post_type=”post” AND p.post_status=”publish” AND DATEDIFF(NOW(), p.post_date) > 180 AND tr2.term_taxonomy_id IS NULL; Lets try another way … Read more

Is it possible to use the_post 2 times in one loop

Yes, but not by calling the_post twice in a loop. Instead, use 2 loops and rewind_posts. The first loop displays column1 and skips even posts. Then you call rewind_posts() to go back to the beginning. The second loop displays column2 and skips odd posts. After the first loop, call rewind_posts(); and it will rewind the … Read more

WordPress converting ‘ to ’ and – to –?

This is wptexturize which includes a number of other transforms too. You can disable wptexturize completely with add_filter( ‘run_wptexturize’, ‘__return_false’ ); which you can put in your child theme’s functions.php, or in a one-file plugin or similar. I can’t see a way to disable just these rules specifically.

Hide page title on dedicated posts page

With the limited information here, it’s hard to point you in the right direction…so I’ll try my best. Assumptions: You are using the WordPress theme twentytwentythree or newer The best way I’ve found to do this is by going finding the Template and overriding it. To find the default template for Blog posts: Go to … Read more

Show posts assigned to multiple categories in current category page

That’s because that’s what you’re asking for: ‘category__in’ => array($category), It’s only going to show posts in that category. You shouldn’t be using get_posts() or WP_Query() in category.php. WordPress has already queried the correct posts. You should only be using the standard loop to display them: <?php if ( have_posts() ) : while ( have_posts() … Read more