How do I use wp_nav_menu?
An alternative approach: use inherited CSS classes. .navbar-nav.ml-auto > li { background: yellow; } .navbar-nav.ml-auto > li > a { color: blue; } That way, you only need to set the class on the <ul>.
An alternative approach: use inherited CSS classes. .navbar-nav.ml-auto > li { background: yellow; } .navbar-nav.ml-auto > li > a { color: blue; } That way, you only need to set the class on the <ul>.
Move the outer(of the two) div.local_faq inside the if statement which checks if the faq field is set, because that’s the outer parent container. Also it would make sense to change the outer container div to have a plural div.local_faqsclass instead of the same class as the nested div.local_faq Then just add the h3 part … Read more
Most of this code is unnecessary. You’re attempting to convert a URL to a path when you could just use the function that returns a path. $path = get_theme_file_path( ‘archive.php’ ); if ( file_exists( $path ) ) { echo ‘File Found: ‘. $path; } else { echo ‘File Not Found: ‘. $path; }
The problem in your code is that your function is only returning the content when is_page() is true, which is not on the default search results page, where is_search() is true. Likewise, the content would also not be returned on singular post pages and anywhere where is_page() is not true. So remember that a filter … Read more
but now in WordPress 6.0, there is no such attribute that exists in Gutenberg to select a new page template. This is not true! WP 6.0 did not remove this functionality. In fact in the block editor it is even more prominent and has its own dedicated panel if you scroll up the sidebar: If … Read more
This sort of theme mod is only capable of conveying a string into the markup regardless of any sanitization callback – any PHP included within the string will never be interpreted by the PHP engine, short of running the output through eval() which would be extremely dangerous and likely result in the theme failing review … Read more
Unfortunately there doesn’t seem any way to hook into the underlying get_pages call that the control dropdown-pages uses, so you’ll have to build your own set of choices (that includes private pages) and use the standard select control type instead: if ( ! class_exists( ‘WPSE_406789_Walker_Page_Options’ ) ) { class WPSE_406789_Walker_Page_Options extends Walker_Page { public $choices … Read more
Because print_r prints a readable version of your variable $media, which will be an array as per the documentation for get_media_embedded_in_content(). You see Array ( [0] => [youtube embed] ) in your browser because it’s rendering the HTML of the array element – if you check the source code of your page you would see … Read more
This is how I do it in a custom theme: <h3>Select pages to include in menu:</h3> <p> <?php $page_ids = get_all_page_ids(); $current_selected = get_option(“pages_to_include”); foreach( $page_ids as $page_id ) { if( get_post_status( $page_id ) == ‘publish’ ) { $checked = ( !empty( $current_selected ) && in_array( $page_id, $current_selected ) ) ? ‘ checked=”checked”‘ : ”; … Read more
Use a custom pagination function: my source: function fb_paging_bar( $args = array() ) { $defaults = array( ‘range’ => 4, ‘custom_query’ => FALSE, ‘previous_string’ => __( ‘«««’, FB_GREYFOTO_TEXTDOMAIN ), ‘next_string’ => __( ‘»»»’, FB_GREYFOTO_TEXTDOMAIN ), ‘view_fp’ => TRUE, ‘view_lp’ => TRUE, ‘before_output’ => ‘<div class=”postlink”>’, ‘after_output’ => ‘</div>’ ); $args = wp_parse_args( $args, apply_filters( ‘fb_paging_bar_defaults’, … Read more