How can I add a Description column to the media library browser screen?

I think I’m getting hung up on this line: echo substr(strrchr($meta[‘attachment_content’], “https://wordpress.stackexchange.com/” ), 1); Yep! Try this version of the description_value function: function description_value($column_name, $id) { echo get_the_content($id); } Media items are posts of the type attachment. The description is stored in the post_content property of the post object. You can see all of the … Read more

Loops in category description

What you want to do is to group fruits by color. In WordPress term appropriate mechanism for that is taxonomy (categories and tags are examples of taxonomy). I would create a custom taxonomy “fruit color” where terms would be individual colors and assigned to fruits. Then your display logic would be to: retrieve all fruit … Read more

Pass $item->description to start_lvl

// Get menu description as global variable function add_menu_description( $item_output, $item, $depth, $args ) { global $description; $description = $item->post_content; return $item_output; } add_filter( ‘walker_nav_menu_start_el’, ‘add_menu_description’, 10, 4); // Submenu walker to add image class submenu_walker extends Walker_Nav_Menu { function start_lvl( &$output, $depth = 0, $args = array() ) { if(0 == $depth) { global … Read more

WPML – Auto Duplicate Post Issue

The problem is that you are unsetting the default language form $langs array, so when you loop over $langs to make the duplicates, the default language is never included. This may be the cause of your problem (nothing to do with WordPress by the way). function wpml_duplicate_on_publish($post_id) { global $post, $sitepress, $iclTranslationManagement; // don’t save … Read more

How to disable site title and description when custom header is uploaded on the customizer?

<div class=”table-cell”> <?php if ( has_custom_header() ) : ?> <?php the_custom_header_markup() ?> <?php else : ?> <h1 class=”blog-title”><?php bloginfo(‘name’); ?></h1> <h5 class=”blog-tagline”><?php bloginfo(‘description’); ?></h5> <div class=”image-title”><img src=”https://wordpress.stackexchange.com/questions/248807/<?php bloginfo(“template_url’); ?>/images/image.png” /></div> <?php endif ?> </div>

Assign a default description to new terms under a custom taxonomy

There are many options to go solve your concern, one could be: First: you need a custom field to store your placeholder. For that you should use the add_term_meta function. Second: Use get_term_meta to retrieve the custom field value. That’s all. If you want customizations you will need to specify a little bit more in … Read more

View tag description on page

Your $tag_id variable is not defined before use. Try a test with a fixed value in there: <p class=”klientWlasciciel”>WLASCICIEL: <?php echo ‘Tag Description: ‘ . tag_description( ‘1’ ); ?> </p> … or test the default behavior which should be the current queried tag: <p class=”klientWlasciciel”>WLASCICIEL: <?php echo ‘Tag Description: ‘ . tag_description(); ?> </p> https://codex.wordpress.org/Function_Reference/tag_description