How to add new custom page or post blocks?

You’re looking for custom meta boxes. These allow you to add sections to the WordPress post and/or page screens that look like standard title, editor, category selection, etc. Generally speaking, you determine where they are rendered and what type of input elements are used. Without knowing exactly what you’re trying to do, it’s not possible … Read more

Trying to perform complex custom field query with order by set to field value

If the value of your custom fields is numeric, you could try ordering with meta_value_num. Also note that both meta_value and meta_value_num require meta_key in the query as described here. $args = array( ‘post_type’ => ‘post’, ‘posts_per_page’ => $number, ‘meta_query’ => array( ‘relation’ => ‘OR’, array( ‘meta_key’ => ‘event-start’, ‘value’ => $today_is, ‘type’ => ‘NUMERIC’, … Read more

Custom text-only header

File: functions.php It’s as easy as adding this to your functions.php file (of course having $wpse67109 set). add_theme_support( ‘custom-header’, $wpse67109_defaults ); File: index.php or any other template Simply don’t add the whole get_head_image() and get_custom_header()->foo stuff anywhere. Your headline template part could look like the following example: <header> <hgroup> <h1 class=”site-title”> <?php if ( display_header_text() … Read more

Making a configurable field translatable

What I have seen in translation plugins (qTranslate, WPML, Multilingual Press) are two approaches. One is qTranslate’s (and the defunct xLanguage): use one field (one for title, other for content, etc) to hold all translations. And then, in the front end, decode its output according to the actual language. <!–en–>English<–:–><!–es–>Español<–:–> In the back end, the … Read more

How can I save repeatable fields with one value inside an array?

You are saving only one image and one image caption. Your loop in dsslider_manager_save_extras function loops throught global $custom_meta_fields defined in php file. Not through $_POST variable. Your loop should look something like this: foreach ( $_POST[‘fields’] as $field ) { … } In HTML, the form should look like this <input type=”hidden” name=”fields[$field[ID]]” value=””/> … Read more

How to oEmbed from custom field, responsive to container size and responsive

I completed the task with fitvids.js by using the plugin FitVids for WordPress. Chris Coyier describes the integration with WordPress in his screencast Integrating FitVids.js into WordPress (on YouTube). My custom field name is video_url. I used the following code in my template: <?php if (!((get_post_meta($post->ID, ‘video_url’, TRUE))==”)) { echo wp_oembed_get( get_post_meta($post->ID, “video_url”, true) ); … Read more

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