Get fields of a widget
Get fields of a widget
Get fields of a widget
I think you mean a query like this one: $args = array( ‘post_type’ => ‘foo’, ‘meta_key’ => ‘bar’, ‘meta_value’ => ‘pineapple’, ‘posts_per_page’ => 1, ); $query = new WP_Query( $args ); You can check out further information here on meta queries in WP_Query. If you only want to check if there exists such a post, … Read more
You can do something like this: function wpse_61041_add_custom_box() { //Place your custom post types in the array $post_types = array ( ‘post’, ‘page’, ‘another_custom_post_type’ ); //Then loop through all post types and add meta boxes to them foreach( $post_types as $post_type ) { add_meta_box( ‘wpse_61041_sectionid’, ‘Does this page is in Englsih?’, ‘wpse_61041_inner_custom_box’, $post_type, ‘side’, ‘high’ … Read more
Meta Box Data added to header redirect
Just got this working adding a text metabox for the youtube id. Then added this lines before the link in the slider just below the opening tag: <?php if ( get_post_meta( get_the_id(), ‘video’, true) != ” ) { $video= get_post_meta( get_the_id(), ‘video’, true); ?> Here goes the embed code but we replace with <?php echo … Read more
There are surely many other ways to archive something like this but the easiest – in my opinion – would be to create or generate a custom post type and the use of a plugin like Advanced Custom Fields which gives you the possibility to create a metabox with filtered post relations.
I just coded a workaround solution for this issue, if anyone is interested here is my solution: This solution is using the Bootstrap Navs Option , so you need first to download Bootstrap and link it in your header or index file. Please read the comments in the below code carefully to can understanding what … Read more
In database, it stores the date details with prefix as _start and _end so you need to change the meta keys accordingly. Please have a look at the below code. <p>Start time details</p> <p>Date: <?php echo get_post_meta($post->ID, ‘_start_day’, true);?>.<?php echo get_post_meta($post->ID, ‘_start_month’, true);?>.<?php echo get_post_meta($post->ID, ‘_start_year’, true);?></p> <p>Hour: <?php echo get_post_meta($post->ID, ‘_start_hour’, true);?>:<?php echo get_post_meta($post->ID, … Read more
How to show metabox key to custom post?
change the line if ( ‘page’ == $_POST[‘post_type’] ) { To if ( ‘page’ == get_post_type($post_id) ) {