Function that outputs second theme url

You can use two inbuilt functions to do this. switch_to_blog get_stylesheet_directory_uri You can use both in the following way to make a function out of it which would give you the url to the theme. Put the below in the functions.php file function wpse_get_theme_url( $blog_id = 1 ){ switch_to_blog( $blog_id ); $template_url = get_stylesheet_directory_uri(); restore_current_blog(); … Read more

Admin: sub menu doesnt display under apperance when activate my themes

Most of those are controlled by your theme support. The functionality does not come for “free” with WordPress, you need to implement the actual code. Once you have put together the code for your theme to support one of the features you can enable it with add_theme_support. for example, in functions.php: add_action( ‘after_setup_theme’, function () … Read more

Integrate WooCommerce theme with a WordPress theme [closed]

I would add it from the start so you don’t have to go back to it, and it’s a really simple process of creating a woocommerce.php file in your theme and then add the following to your functions.php add_action( ‘after_setup_theme’, ‘woocommerce_support’ ); function woocommerce_support() { add_theme_support( ‘woocommerce’ ); } To create the woocommerce.php, copy your … Read more

Updating / Transferring site

Well you can export all your existing content from Tools -> Export -> All Content save the xml file and import it into your new wordpress. Test it on your localhost first so you can make sure that all of your content is imported.

Customizer – loading settings/controls/sections/panels based on a id/page id

The most robust way to do this is to do JavaScript-based instantiation of the sections, controls, and settings dynamically in response to the URL being previewed. Since you can navigate around the site in the preview, this will ensure that the post/page-specific sections and controls will be created as you need them when you navigate … Read more

proper way to add css using functions.php?

Your add_action() is incorrect: add_action(‘wp_enqueue_scripts’, ‘wp_enqueue_style’); The 2nd argument is supposed to be the function that you enqueue your stylesheet in. In you case that’s fearnothing_script_enqueue(): add_action( ‘wp_enqueue_scripts’, ‘fearnothing_script_enqueue’ );

Does wordpress templates always in files or in database?

But there is no content directory in template directory. Actually, with the following: get_template_part( ‘templates/content’, ‘header-private’ ); get_template_part( ‘templates/content’, ‘header-public’ ); WordPress will search in the templates folder for content-header-private.php or content-header-public.php, and if found, it is loaded. Else, WordPress will attempt to load the content.php file instead. So WordPress (or get_template_part()) will not search … Read more