SQL trigger failes with post_content

I’ve written a filter for you. It will filter the character before the post get saved in the database and it’s using the WordPress way. If you use this I think you’re not gonna be needed the trigger. Here it is- add_filter( ‘wp_insert_post_data’ , ‘the_dramatist_filter_content_before_insert’ , ’99’, 2 ); function the_dramatist_filter_content_before_insert( $data , $postarr ) … Read more

add css to only body text

On your CSS rule for the .single img, you are currently setting only the maximum width, and the padding you set applies to the image itself within the body’s box. Try setting the image to full width and pulling the sides out with negative margin: .single img { width:100%; margin: 0 -100px; }

Retrieve content of page by URL Parameter

There is a way, simply register your query: function my_query($vars) { return array(‘your_query’) + $vars; } add_filter(‘query_vars’, ‘my_query’); And get custom template the query exists (here /?your_query=first gets template called custom_template.php from your theme folder. function my_query_template($template) { global $wp; if ($wp->query_vars[‘your_query’]==’first’) { return dirname( __FILE__ ) . ‘/custom_template.php’; } else { return $template; } … Read more

How can I extract or parse data from post contents’ shortcodes into an array?

Not really a WordPress question, but you can use the PHP function preg_match_all to extract all the text wrapped in [cs_text] tags like so: function wpse_265295_extract_cs_text( $subject ) { $pattern = “#\[cs_text\](.*?)\[/cs_text\]#s”; preg_match_all( $pattern, $subject, $matches ); return isset( $matches[1] ) ? $matches[1] : []; } If you’re looking to extract arbitrary shortcodes: if( ! … Read more

Displaying Post Content on tooltip

The problem is that your template doesn’t have any quotes around the title attribute at all: title=<?php echo get_the_content(‘post_content’, $post->ID); ?> So the browser’s making its best guess and using the first word. So you need to add the quotes: title=”<?php echo get_the_content(‘post_content’, $post->ID); ?>” Also, if you’re outputting arbitrary content into an attribute you … Read more

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