WordPress custom taxonomy description for each post?

sounds like a silly question but are you echo’ing it out? <?php echo term_description($term_id, $taxonomy); ?> otherwise you’ll need to get the current post’s terms (where my_term is your custom taxonomy): $terms = wp_get_post_terms( $post->ID, ‘my_term’ ) then get the description for the first term in ther array: echo term_description($terms[0]->term_id, ‘my_term’); I’ve not tested this … Read more

How do i hide the if the appears

There are two ways to do this, though one is arguably better than the other. Use JavaScript (Works, but not optimal) The first way to do this is by using JavaScript. I’m not a fan of using this approach because it requires a web browser to perform the toggling. This negatively impacts SEO because, to … Read more

How can I remove “Proudly powered by WordPress” from twentyeleven without modifying footer.php?

There are 3 methods. Somewhat weird but since this text is internationalized you can filter the output. This is just an example to remove the text, the link is still present in the source. add_filter(‘gettext’, ‘remove_powered_by’, 20, 3); function remove_powered_by( $translated_text, $untranslated_text, $domain ) { $custom_field_text=”Proudly powered by %s”; if ( !is_admin() && $untranslated_text === … Read more

wp_mail function timing out

Well, this isn’t a full solution per se, but I would start by isolating whether the problem is the SQL queries or the wp_mail() call. If you comment out the wp_mail() line, you can get an idea of how long the function takes to run the queries and build the messages without trying to send … Read more

Permanently remove first image from posts

Just as @s_ha_dum suggests, you can loop through all of your posts and update the content of each one. The following gives you the idea but is untested: $posts = get_posts( array( ‘post_type’ => ‘post’, ‘posts_per_page’ => 500, ‘offset’ => 0, ) ); foreach( $posts as $post ): // Update each post with your reg-ex … Read more

Moving a PHP web-app to WordPress

In my opinion as long as your needs are exclusively about looks it’s never a good reason to migrate to entirely different code base. The separation of backend code and frontend site is inherently one of the strengths in web development. When you you are a lone developer on own project there are roughly three … Read more

Conditionally loading JavaScript based on the Advanced Custom Fields in the post

ACF has finegrained filters for fields when they get loaded. add_action( ‘wp_enqueue_scripts’, ‘register_my_scripts’, 5 ); function register_my_scripts() { wp_register_script( ‘my-script’, ‘path-to/my-script.js’, array(), ‘version’, true ); } add_filter(‘acf/load_field/name=my_field_name’, ‘load_field_my_field_name’); function load_field_my_field_name( $field ) { wp_enqueue_script( ‘my-script’ ); return $field; } Normally all scripts should be enqueued in wp_enqueue_scripts hook. So you should make sure your script … Read more