Tag Info

New answers tagged

1

add_action("admin_init", "admin_init"); add_action('save_post', 'save_reference_id'); /*** add_meta_box ***/ function admin_init(){ // adding a custom field to post type 'case' add_meta_box("refInfo-meta", "Reference", "meta_options", "case", "side", "high"); } /*** callback ***/ function meta_options(){ ?> <select name="page_id" ...


1

the_title() and the_permalink() are functions that automatically echoed. Use in this case get_the_title() and get_permalink(). the code should look something like this: while ( $query->have_posts($post->ID) ) : $query->the_post(); echo '<li><a href="'. get_permalink(). '">' .get_the_title() .'</a></li>'; endwhile; ...


1

As answered by Steven Jones in the comments, I just want to confirm that the key thing is the specify your custom post type's settings to be 'hierarchical' => true, not the hierarchical argument in wp_dropdown_pages function. If you are using a custom plugin like Types or CPT UI, just set the option to true.


0

You need an update method which saves your widget settings: function update( $new_instance, $instance ) { for ( $i=0; $i < 3; $i++ ) $instance[ "link_target_$i" ] = $new_instance[ "link_target_$i" ]; return $instance; }


0

Thanks to mstoic for pointing out that this is not default WP functionality. This ended up being an unhelpful feature (for me) used in a WordPress stack. I found the offending line and commented it out. $output .= "\n<ul class=\"dropdown\">\n"; } function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0) { $item_html = ...


1

Can you add the complete output code for the navigation menu. The code you pasted seems to be a stripped version. Moreover, WordPress adds 'current_page_item' class to the list item if it is currently being viewed. For more info, check this WordPress documentation on classes added to Navigation menu items.



Top 50 recent answers are included