Use custom field value as href

To retrieve a value after using add_settings_field() you should use get_option(). So you could do something like this… $value = esc_html(get_option(‘option_name’)); if ($value) { echo ‘<a href=”‘ . $value . ‘”>Click Here</a>’; } You just need to change option_name to your field name. The code will grab the value and if it isn’t false echo … Read more

Custom Search, MySql Query Gone Wrong?

This doesn’t seem especially complex, but does seem bulky and prone to errors. As I answered couple of times on similar issues – if this isn’t time critical then wait for WP 3.1 because it will have major improvements for querying by custom fields. See Advanced Metadata Queries for brief writeup on upcoming improvements. For … Read more

custom field as a boolean with a checkbox?

Have you already looked at the output of WP_Query, if you don’t submit the “meta_query” key? Do you get the posts for the event-posttype? If yes, then you could check what the “more fileds”-plugin puts in the “event-archive” custom field. Maybe you have to set the value to integer 1 or just submit a boolean … Read more

How can I display only the post titles from a selected category in columns?

Updated answer: Use two floated lists to emulate columns, same approach as previously though. <?php /* Template Name: PageOfPosts */ get_header(); ?> <div id=”content”> <div class=”t”> <div class=”b”> <div class=”l”> <div class=”r”> <div class=”bl”> <div class=”br”> <div class=”tl”> <div class=”tr”> <div class=”pad”> <?php while( have_posts() ) : the_post(); ?> <?php $category = get_post_meta( get_the_ID(), ‘category’, … Read more

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