Tag Info

Hot answers tagged

6

The first location where PHP would look for relative path will not be the file you specify include in, but relative to point of entry file (index.php or whatever). Files are included based on the file path given or, if none is given, the include_path specified. If the file isn't found in the include_path, include will finally check in the calling ...


5

Yes it is. It might get a bit clearer if you re-format this line $title .= " $sep " . sprintf( __( 'Page %s', '_s' ), max( $paged, $page ) ); to: $title .= " $sep "; $title .= sprintf( __( 'Page %s', '_s' ), max( $paged, $page ) ); The first parameter of sprintf expects a format which is here the return value of the __ function. The second ...


1

You can try the Theme Test Drive plugin to help you preview a development copy of your theme while a live site is still fully functional. Assuming it's the same theme you are working on (as it sounds like it) - you can copy the existing theme to a new theme folder, and just change the Theme Name value in the style.css in the development copy... then ...


1

I would not try to get too tricky and hide pages from users. What happens if they try to create a page with the same slug? I think it would just create confusion and more problems than it would solve. When you create the pages, store their IDs, not slug. Let users then change those through your options screen. This is similar to how WordPress tracks your ...


1

There are a few steps you need to take to add menus, the wordpress way. Register the menu in functions.php using register_nav_menus() Codex Link: https://codex.wordpress.org/Function_Reference/register_nav_menus Example: register_nav_menus( array( 'my_custom_menu' => 'My Custom menu', 'my_other_menu' => 'My Other Menu', ) ); Now you ...


1

The best way to customize a navigation menu is to use a custom 'walker' function.. Here are the steps how to achieve the customization that you want! Create a "wp-custom-nav-walker.php" file in your theme directory for a new custom 'walker' class. Extend the Walker_Nav_Menu class and copy the class' function that you want to modify and override it in the ...


1

The style_loader_src filter is used to modify/filter the src (url) of a stylesheet. The function callback accepts two parameters, the first is the original src and the second the handler of the stylesheet. The handler is the first parameter of wp_enqueue_style() used to enqueue the stylesheet. So, to replace a stylsheet source with another one you should ...



Only top voted, non community-wiki answers of a minimum length are eligible