Changing the HTML Of the content

The wrapping <p> is applied by a filter called wpautop. You can disable this filter and wrap the content in your desired wrapper, but it’s not really recommended. remove_filter( ‘the_content’, ‘wpautop’ ); remove_filter( ‘the_excerpt’, ‘wpautop’ ); Now you can wrap your content in a DIV for example: <div><?php the_content(); ?></div> But notice that this filter … Read more

Problems migrating WordPress to localhost

First of all what I assume is your local server is not parsing the php properly. So just put a simple phpinfo file and see if that show you the expected page. You can take reference from the following link if you don’t know how to create a phpinfo page – https://mediatemple.net/community/products/dv/204643880/how-can-i-create-a-phpinfo.php-page If the above … Read more

Edit postmeta when user changes user role?

Well, you’re not entirely correct. This code will run, when the action called basic will be called using do_action(‘basic’, …). But… There is no such action in WP core, so your code won’t run at all, I’m afraid. There is hook that might be helpful in your case. It’s called set_user_role and it has 3 … Read more

Retrieving all data from repeater fields

Please use below code to get list item <?php // check if the repeater field has rows of data if( have_rows(‘what_we_do_textarea_two’) ): // loop through the rows of data while ( have_rows(‘what_we_do_textarea_two’) ) : the_row(); // display a sub field value the_sub_field(‘list_item’); endwhile; else : // no rows found endif; ?>

Get used terms by an author as array of strings

I don’t know which line that error refers to but this code works correctly if everything falls into place exactly right. But there are actually several ways this could go wrong. For example, if get_query_var(‘author_name’) is not set you get an error on this line: $used_terms=list_author_used_terms($user->ID); If a problem occurs here: $terms = wp_get_object_terms( $p->ID, … Read more