Trying to display text in a block in a plugin page

EDIT 2: I come up with this kind of dirty solution, which is a function creating temporary array. It will contains the segment of the string you want to add line breaks to. Then we set it back as a string using implode. function breakLines($str,$line_length=30,$implodechar=”<br>”) { $str_length = strlen($str); $i=0; $o=0; $tmp = array();//temporary array … Read more

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

home.php show blog posts as grid view

It’s a little bit hard to guess, what exactly do you want to achieve (you’ve mentioned something about four posts in a row and then there is number 6 in your for loop), but… If you want to display only 4 posts in your loop, then you can use current_post field of $wp_query, so the … Read more

PHP E_WARNING being shown despite php.ini [closed]

Did you check your wp-config.php file for WP_DEBUG constants? //enable debug define( ‘WP_DEBUG’, true ); //save to file define( ‘WP_DEBUG_LOG’, true ); //show in browser define( ‘WP_DEBUG_DISPLAY’, true); See https://codex.wordpress.org/WP_DEBUG for more details.

List post by title length

Add the following to your functions.php for the on save. This will create a meta value on save that stores the length of the post title. function save_crosses_title_length( $post_id ) { $title = get_the_title($post_id);//get the title $length = strlen( $title );// get the length of title if ( get_post_meta( $post_id, ‘name_length_crosses’ ) ) {//if meta … Read more

Integrating Yii2 and WordPress

To integrate with wordpress you need to fully execute wordpress. At this point the added value of having yet another framework is probably zero as it will be easier to just do whatever you need in wordpress over the effort of integration, an effort you might need to keep doing on every new release of … Read more