Two Navigation Menus in Themes Produce the same menus?
Try theme_location instead of menu in arguments. Too late here to look up specifics, but I remember documentation/code being absolutely confusing about that.
Try theme_location instead of menu in arguments. Too late here to look up specifics, but I remember documentation/code being absolutely confusing about that.
Own theme If you are using your own theme, no need to worry about, because /languages folder is in your control that way. 🙂 Other’s theme But your concern is about other’s theme and you want to apply your translations into that theme, then the best way is to make a Child Theme. Because you … Read more
Register a widget, and call it on the front-page when the the_post action is called second time: add_action( ‘wp_loaded’, ‘wpse_80202_register_banner_widget’ ); function wpse_80202_register_banner_widget() { // used on the first page of main loop only register_sidebar( array ( ‘name’ => ‘Banner front-page ‘, ‘id’ => ‘frontpage_banner’, ‘before_widget’ => ‘<div class=”frontpage-banner”>’, ‘after_widget’ => ‘</div>’ ) ); } … Read more
Referencing this question I was able to resolve this issue: Need help with add_rewrite_rule To briefly display the changes I made here it goes, in my theme functions.php I added the following action: add_action(‘init’,’custom_rewrite_rule’); function custom_rewrite_rule(){ add_rewrite_rule(‘^student/([^/]*)/’,’index.php?pagename=student&country=$matches[1]’,’top’); } This above allows for my urls to be the pretty form of: {{site_url}}/student/ca/ {{site_url}}/student/us/ However this form … Read more
This will do: <?php /* * This filter only works with images, for all kind of media check: media_send_to_editor * The priority is set to 20 and it takes 8 arguments */ add_filter(‘image_send_to_editor’, ‘wpse_53577_img_wrapper’, 20, 8); // We are only working with the $html argument, but you can play with all of them function wpse_53577_img_wrapper($html, … Read more
Try the XCloner plugin: http://wordpress.org/extend/plugins/xcloner-backup-and-restore/. I use XCloner to move sites between my live server and my dev server. It takes care of all the migration differences between the domain, database, etc. It preserves all my widget settings, custom menus, etc.
There’s current_user_can( ‘CAPABILITY’ ); (see @Codex Users & Roles to find the appropriate cap for your targeted role), that you can use to determin what theme you want to display. You can also check for is_user_logged_in() if you just want to differentiate between non-logged in and logged in users. Then you have the switch_theme() function. … Read more
To make the header on the Twenty Ten theme less tall (i.e. a height with fewer pixels) put this code at the bottom of your theme’s “functions.php” file (being sure to change the number 180 to whatever height you want): <?php add_action(‘twentyten_header_image_height’,’yoursite_header_image_height’); function yoursite_header_image_height($height) { return 180; // Modify this to whatever pixel height you … Read more
You usually don’t need to enqueue a child theme’s stylesheet. The parent theme does that. This is a bit confusing, so I’ll explain. In most themes, Twenty Seventeen included, the stylesheet is loaded like this: wp_enqueue_style( ‘twentyseventeen-style’, get_stylesheet_uri() ); The trick to understanding what’s going on here is understanding what get_stylesheet_uri() does. When a regular … Read more
There are several steps to creating additional menus using the new menu system in WordPress in the TwentyTen theme or any WordPress theme (of which some of these steps can be done out of order). In addition, I’m going to highly recommend you create a child theme based on TwentyTen instead of modifying it directly: … Read more