Thank you!
Is this possible to do with functions.php, so it will not have be done again after every update?
I am beginner with action and filter hooks, but if “td_social_sharing.php” uses action and filter hooks, could I just copy the hook meant for sharing in Twitter , paste to functions.php and then delete this one line? And the Twitter sharing would be overwritten?
Hei Bettina!
Thank you but I meant to ask, is it possible to display child tags with just one number, the parent tag?
I made my tags hierarcial, so they now have children and parents. So If I have parent tag “ID=1” and lots of child tags “ID=2” “ID=3″ …”ID=25”, is it somehow possible to display them all just writing tag ID number 1 to this filter.
This would be important in this spesific site, for there will be lots of new tags and the one using the site should not need not modify this filter every time they add a new tag. So I need to have parent-child hierarchy and they only need to add their new tag to the right parent.
In what file should I modify the code if that is needed?
I have one more question. When I do have category/tag-list item with hierarcial tags, is there a way to filter it with only parents ID so the children are displaying? I need to have it like that, if someone ads new children to the parent tag, the child will be automatically in the menu. Should I modify the theme code to make this possible?
I made my tag list hierarcial with this snippet if it does matter:
`function wd_hierarchical_tags_register() {
// Maintain the built-in rewrite functionality of WordPress tags
global $wp_rewrite;
$rewrite = array(
'hierarchical' => false, // Maintains tag permalink structure
'slug' => get_option('tag_base') ? get_option('tag_base') : 'tag',
'with_front' => ! get_option('tag_base') || $wp_rewrite->using_index_permalinks(),
'ep_mask' => EP_TAGS,
);
// Redefine tag labels (or leave them the same)
$labels = array(
'name' => _x( 'Tags', 'Taxonomy General Name', 'hierarchical_tags' ),
'singular_name' => _x( 'Tag', 'Taxonomy Singular Name', 'hierarchical_tags' ),
'menu_name' => __( 'Hierarkiset tagit', 'hierarchical_tags' ),
'all_items' => __( 'All Tags', 'hierarchical_tags' ),
'parent_item' => __( 'Parent Tag', 'hierarchical_tags' ),
'parent_item_colon' => __( 'Parent Tag:', 'hierarchical_tags' ),
'new_item_name' => __( 'New Tag Name', 'hierarchical_tags' ),
'add_new_item' => __( 'Add New Tag', 'hierarchical_tags' ),
'edit_item' => __( 'Edit Tag', 'hierarchical_tags' ),
'update_item' => __( 'Update Tag', 'hierarchical_tags' ),
'view_item' => __( 'View Tag', 'hierarchical_tags' ),
'separate_items_with_commas' => __( 'Separate tags with commas', 'hierarchical_tags' ),
'add_or_remove_items' => __( 'Add or remove tags', 'hierarchical_tags' ),
'choose_from_most_used' => __( 'Choose from the most used', 'hierarchical_tags' ),
'popular_items' => __( 'Popular Tags', 'hierarchical_tags' ),
'search_items' => __( 'Search Tags', 'hierarchical_tags' ),
'not_found' => __( 'Not Found', 'hierarchical_tags' ),
);
// Override structure of built-in WordPress tags
register_taxonomy( 'post_tag', 'post', array(
'hierarchical' => true, // Was false, now set to true
'query_var' => 'tag',
'labels' => $labels,
'rewrite' => $rewrite,
'public' => true,
'show_ui' => true,
'show_admin_column' => true,
'_builtin' => true,
) );
}
add_action('init', 'wd_hierarchical_tags_register');`
Got it. I have to put the items in the page and they will automatically be in the menu. Thank you for the help, this looks like a very handy tool!
Okay, I feel stupid to ask this but I do not get it.
So I make a menu header, then I make submenus and make the submenus to be page mega menu – right? Until this I am good.
Then, how can I add the category/tag-element to the mega-menu? It does not “go” there, but rather next to the main menu than inside. I tried to make inline row but the same thing. How can I add elements inside the menu?
Thank you in advantance!
Thank you very much, this helped a lot!
Maybe my first picture was not really good one
https://drive.google.com/file/d/1qbLwdgyFBk_5dMB08ipYwdMMEIR3aC3J/view?usp=sharing
Do you mean I could do this best with megamenu? I do not really understand how. 🙂 I want there to be vertical lists of some categories and tags under some headers as submenu items.
I want there just to be text in the menu, not something like this
https://forum.tagdiv.com/wp-content/uploads/2015/05/Mega-Menu.png
Thank you very much!
Is it possible to do a megamenu with tags, not categories?
Thank you for the very fast response! The page is on Mainteance-mode so I need to send you login details by email.