Modifying child theme’s header

It’s good practice to use: the proper WordPress way of wp_enqueue_scripts to add your scripts and styles; the wp_head hook to add more code into your head section. Read more. Either you can use and place into your functions.php. Let me know if it’s what you were looking for.

How to show category just on specific pages?

try this here i get category on three page function tpa_exclude_technology_cat( $query ) { if ( !$query->get_queried_object_id(‘8’) || !$query->get_queried_object_id(‘Berries page id here’) || !$query->get_queried_object_id(‘Stone Fruits page id here’)) { // “Fruits”-page has id of 8 $query->set( ‘cat’, ‘-3’ ); // “Fruits-Category” has id of 3 } return $query; } add_filter( ‘pre_get_posts’, ‘tpa_exclude_technology_cat’ );

Page template not working when logged out

I found the solutions: I created a duplicate header and footer file named them header-nonavigation.php and footer-none.php In these files, I deleted the navigation code and the footer code (do not hide the navigation/footer for some reason it won’t load the correct php header/footer files) I called to these files in my page template php … Read more

How to transfer variables from one function to another [closed]

Whatever happens in your function (I didn’t look deep in it) you can pass more then one parameter if you call the function na_get_gallery_image_urls($posters_id->ID, $linker_sluger); and use the value. But makes it sense? Once you put an echo in a variable $galeryjka and then you echo the echo?

Redirect User when they click Menu Option

The first problem I see is here: if( get_page_by_slug($slug) ){ }wp_redirect(‘https://example.com/private-page/’.$slug.”https://wordpress.stackexchange.com/”); exit; The if() statement will do nothing; your wp_redirect() and exit statements are outside the {} braces. Try this instead: if( get_page_by_slug($slug) ){ wp_redirect(‘https://example.com/private-page/’.$slug.”https://wordpress.stackexchange.com/”); exit; } Aside from that, a couple other things to check: You say the code is in function.php; if you’re … Read more

how to add functions to my function.php using a child theme?

The site crashes, because you have a typo in that code. You’re missing an apostrophe at the beginning of the string: // Custom Function to Include function my_favicon_link() { echo <link rel=”shortcut icon” type=”image/x-icon” href=”https://wordpress.stackexchange.com/favicon.ico” />’ . “\n”; ^ missing apostrophe } add_action( ‘wp_head’, ‘my_favicon_link’ ); Here’s the fixed version: // Custom Function to Include … Read more