Gutenberg Custom Block

to 1. You closed registerBlockType too early and to avoid further react errors, you should print your return in the same line as return in your edit/save functions. var el = wp.element.createElement; wp.blocks.registerBlockType(‘test/blocks’, { title: ‘Test Blocks’, icon: ‘smiley’, category: ‘common’, attributes: { content: {type: ‘string’} }, edit: function(props) { return el( ‘div’, {}, el( … Read more

Custom fields are not restored to previous revisions

Post revisions are for the fields in the posts database table and not the postmeta database table. So if you want to create your own postmeta revision you could save the meta when the revision is made using _wp_put_post_revision and you can restore the meta using wp_restore_post_revision.

add custom fields to the post on admin side

To insert your own custom field after the title field you will have to invoke the hook edit_form_after_title. You may at the following to your plugin or theme: add_action(‘edit_form_after_title’, function() { global $post; print ‘<input type=”text” name=”post_title” size=”30″ tabindex=”1″ value=”‘.esc_attr( htmlspecialchars( $post->post_title ) ).'” id=”title” autocomplete=”off” />’; }); Note: the default title field will stop … Read more

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

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