Taxonomy Extra Meta [duplicate]

You should be able to do something like this: add_action(“manage_posts_custom_column”, “my_custom_columns”); add_filter(“manage_edit-[POSTTYPE]_columns”, “my_new_columns”); function my_new_columns($columns) { $columns = array( “image” => “Image” ); return $columns; } function my_custom_columns($column) { global $post; if (“ID” == $column) echo $post->ID; elseif (“image” == $column) echo ‘default_value’; } Then you should be able to use $tax_term->image to show it. … Read more

sort a custom field base on the date or anything

Multiline is not an array (rant) You need to use standard dates for this to work DD/MM/YYYY (first row) Use the PHP function usort() to sort the fields Use strtotime() to convert that date to a timestamp and date_i18n() to output it If you need an actual example, change the date formats to what I’ve … Read more

Calling Custom Post Meta

you can use <?=$website_url?> in the portfolio template like <strong>URL: </strong><a href=”https://wordpress.stackexchange.com/questions/32957/<?=$website_url?>”><?=$website_url?></a> to make it like follow <?php /* Template Name: Portfolio */ ?> <?php get_header(); ?> <div id=”content”> <?php $loop = new WP_Query(array(‘post_type’ => ‘portfolio’, ‘posts_per_page’ => 10)); ?> <?php while ( $loop->have_posts() ) : $loop->the_post(); ?> <?php $custom = get_post_custom($post->ID); $screenshot_url = $custom[“screenshot_url”][0]; … Read more

Retrieve IDs from custom field, count and display results differently according to count

I answer to myself, since this code is working better (previous had an issue) and also I removed a useless “for”: echo ‘<ul class=”related-content”>’; $count = 0; foreach(get_field(‘related_content’) as $post_object) : $count++; if ($count > 0 && $count < 4 ) { printf(‘<li class=”large”><a target=”_blank” title=”‘.get_the_title($post_object->ID).'” href=”‘.get_permalink($post_object->ID).'”><span style=”display: block” title=”‘.get_the_title($post_object->ID).'”>’.get_the_post_thumbnail($post_object->ID, ‘small’).'</span><span class=”thumb-title”>’.get_the_title($post_object->ID).'</span></a></li>’); } elseif ($count … Read more

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