نحوه ایجاد شبکه چندسایتی و استفاده از قالب فرزند آسترا در آن
با کمک ویژگی چندسایتی، میتوانید شبکهای از وبسایتها را از یک مکان واحد کنترل کنید. با استفاده از این سبک نصب وردپرس، میتوان شبکهای از چندین وبسایت را از یک داشبورد وردپرس ایجاد و مدیریت کرد.
قالب آسترا پرو فارسی

این امر بهروزرسانی همه وبسایتهای شما و ایجاد تغییرات از یک مکان واحد را ساده میکند. تعداد وبسایتها میتواند از ۲ تا چند میلیون متغیر باشد. به عنوان مثال، وردپرس از این ویژگی برای نگهداری ۳۷ میلیون وبسایت در یک مکان استفاده میکند.
قالب فرزند چیست؟
قالب فرزند، کپی قالب والد است که تمام ویژگیها و سبکها را از قالب والد به ارث میبرد. کاربرد اصلی قالب فرزند، امکان سفارشیسازی در فایلهای قالب است.
هر تغییری که مستقیماً در فایلهای قالب ایجاد کنید، هنگام بهروزرسانی قالب پاک میشود. ویرایش فایلهای قالب با استفاده از قالب فرزند تضمین میکند که کدهای سفارشی که برای ویرایش فایلهای قالب استفاده میکنید، حتی پس از بهروزرسانی قالب سایت، در وبسایت شما باقی میمانند.
در اینجا مقالهای وجود دارد که میتواند شما را در جزئیات بیشتر در مورد قالب فرزند آسترا راهنمایی کند.
نقشهای کاربری
مدیر شبکه: وقتی یک سایت چندگانه در وبسایت وردپرس خود ایجاد میکنید، شما را به مدیر شبکه سایت خود تبدیل میکند. همچنین به کاربران شما اجازه میدهد سایتهای شخصی خود را ایجاد کنند و مدیر سایتهای مربوطه خود باشند.
مدیر سایت: این کاربران میتوانند سایت خود را در داخل شبکه چندسایتی شما ایجاد کنند. با این حال، نمیتوانند افزونه جدیدی نصب کنند در حالی که میتوانند افزونههای نصب شده توسط مدیر شبکه را فعال و استفاده کنند.
مدیر سایت سطح دسترسی پایینتری نسبت به مدیر شبکه دارد. مدیر سایت میتواند کاربران جدید اضافه کند و به آنها نقش مدیر سایت بدهد. با این حال، دسترسی آنها به سایتی که به آن اضافه شدهاند محدود خواهد شد.
نام دامنه
یکی از جنبههای مهم سایت چندگانه این است که میتوانید تنظیم کنید که آیا زیرسایتهای درون شبکه شما میتوانند از زیردامنهها (example-site.mysite.com) یا زیردایرکتوریها (mysite.com/examplesite) استفاده کنند.
همچنین میتوانید دامنههای دیگر را به شبکه خود نگاشت کنید تا گزینههایی برای سایتهای درون شبکه شما فراهم شود تا نام دامنههای شخصی داشته باشند.
نحوه راهاندازی و فعالسازی چندسایتی
هنگام استفاده از قالب آسترا، میتوانید از قالب فرزند برای راهاندازی هر تعداد سایتی که میخواهید در نصب وردپرس خود استفاده کنید. در اینجا مراحل دقیق نحوه راهاندازی شبکه چندسایتی با استفاده از قالب فرزند آمده است.
لطفاً توجه داشته باشید که توصیه میکنیم قبل از فعال کردن ویژگیهای چندسایتی، از وبسایت خود یک نسخه پشتیبان کامل تهیه کنید. در اینجا مقالهای وجود دارد که به شما در پشتیبانگیری از وبسایتتان کمک میکند.
فعالسازی ویژگی چندسایتی
با هر نصب وردپرس، ویژگی شبکه چندسایتی از قبل نصب شده است. تنها کاری که باید انجام دهید این است که وردپرس را طبق معمول راهاندازی و نصب کنید. سپس فقط باید ویژگی چندسایتی را روشن کنید.
مرحله 1: دانلود و نصب افزونه مدیریت فایل
هر وبسایت وردپرسی که از قبل وجود دارد، میتواند قابلیت چندسایتی را فعال کند. برای فعال کردن چندسایتی، با استفاده از یک سرویس گیرنده FTP یا مدیر فایل cPanel به سایت خود متصل شوید و فایل wp-config.php را برای ویرایش باز کنید.
در این مثال، از افزونهای به نام مدیریت فایل استفاده خواهیم کرد که میتوانید از اینجا دانلود کنید. افزونه را دانلود کرده و آن را در سایت وردپرس خود آپلود کنید و آن را نصب و فعال کنید.
ast-file-manager-plugin
مرحله 2: ویرایش فایل wp-config.php
پس از فعال کردن افزونه، فایل wp.config.php را پیدا کرده و روی آن کلیک راست کنید. این کار یک منوی کشویی باز میکند. از منو، ویرایشگر کد را انتخاب کنید.
ast-plugin-file-manager-code-editor
پس از باز شدن ویرایشگر کد، کد زیر را کپی کرده و در ویرایشگر کد در پایین قرار دهید. برای ذخیره تغییرات، روی ذخیره و بستن کلیک کنید.
define('WP_ALLOW_MULTISITE', true);
ast-plugin-file-manager-code-editor
توجه: هنگام ویرایش فایل wpconfig.php، لطفاً مطمئن شوید که کد بالای متنی که میگوید "/* That's all, stop editing! Happy publishing. */" را قرار میدهید.
قابلیت چندسایتی سایت وردپرس شما با این کد فعال میشود. پس از فعال شدن، شبکه چندسایتی هنوز باید تنظیم شود.
راهاندازی شبکه چندسایتی
حالا بیایید شبکه چندسایتی را پیکربندی کنیم:
مرحله ۱: غیرفعال کردن همه افزونهها
در مرحله بعد، اگر در حال راهاندازی شبکه چندسایتی در یک وبسایت وردپرس موجود هستید، باید همه افزونههای وبسایت خود را غیرفعال کنید. به افزونهها > افزونههای نصبشده بروید و همه افزونهها را انتخاب کنید. در گزینه عملیات دستهجمعی، گزینه غیرفعال کردن را انتخاب کنید و روی اعمال کلیک کنید.
ast-dsiable-all-plugin
مرحله ۲: نصب تنظیمات شبکه
پس از غیرفعال شدن همه افزونهها، برای پیکربندی شبکه چندسایتی به ابزارها > تنظیمات شبکه بروید.
ast-tools-network-setup
در صفحه تنظیمات شبکه، باید نام شبکه و آدرس ایمیل خود را وارد کنید. لطفاً مطمئن شوید که آدرس ایمیلی که ارائه دادهاید صحیح است. پس از آن، روی دکمه نصب در پایین کلیک کنید.
ast-network-set-up-install
پس از کلیک بر روی دکمه نصب، در صفحه بعدی، وردپرس چند کد را نمایش میدهد که باید آنها را به فایل wpconfig.ph اضافه کنید.
فایلهای p و htaccess.php.
شما میتوانید فایل را به طور مشابه با رفتن به افزونه مدیریت فایل، کلیک راست روی فایلهای مربوطه، انتخاب ویرایشگر کد، چسباندن کدها و کلیک روی دکمه ذخیره و بستن ویرایش کنید.
ast-tools-network-setup-codes
مرحله 3: داشبورد شبکه
پس از تنظیم تنظیمات شبکه، برای ایجاد تغییرات در چندسایتی به داشبورد شبکه بروید. روی My Sites در نوار بالای داشبورد وردپرس خود کلیک کنید، Network Admin را انتخاب کنید و روی Dashboard کلیک کنید.
ast-network-admin
پس از کلیک روی داشبورد، داشبورد شبکه و داشبورد "Right Now" را مشاهده خواهید کرد. میتوانید یک سایت جدید و یک کاربر جدید ایجاد کنید یا سایتها یا کاربران موجود را جستجو کنید.
مرحله 4: پیکربندی تنظیمات شبکه
پس از دسترسی به داشبورد مدیر شبکه، روی Settings کلیک کنید و Network Settings را انتخاب کنید. این کار گزینههای تنظیمات شبکهای را که باید پیکربندی کنید، باز میکند.
مهمترین تنظیم در پیکربندی شبکه شما معمولاً در بخش «تنظیمات ثبتنام» در صفحه تنظیمات شبکه یافت میشود. در شبکه، ثبتنام کاربر و سایت به طور پیشفرض غیرفعال است.
شما میتوانید هم ثبتنام سایت و هم ثبتنام کاربر را در وبسایت خود مجاز کنید، و همچنین به کاربران فعلی اجازه دهید سایتهای جدید بسازند.
این به شما امکان میدهد سایتهای جدیدی را به شبکه چندسایتی خود اضافه کنید.
ایجاد یک سایت جدید
در داشبورد شبکه، برای ایجاد یک سایت جدید، روی گزینه «ایجاد یک سایت جدید» کلیک کنید.
ast-network-create-new
برای ایجاد یک سایت جدید باید اطلاعات زیر را وارد کنید.
آدرس سایت (URL): این نام وبسایت شما و به دنبال آن دامنه اصلی خواهد بود. به عنوان مثال، storyteller.wpastra.com. در اینجا storyteller نام وبسایت و wpastra.com آدرس دامنه اصلی است.
عنوان سایت: این عنوان سایتی است که در بالای داشبورد نمایش داده میشود.
زبان سایت: به طور پیشفرض، عنوان سایت به صورت انگلیسی (ایالات متحده) انتخاب میشود. اگر میخواهید زبان را تغییر دهید، میتوانید از منوی کشویی انتخاب کنید.
ایمیل مدیر: به طور پیشفرض، این آدرس ایمیلی را که قبلاً هنگام ایجاد شبکه وارد کردهاید، نمایش میدهد. در صورت تمایل، میتوانید آن را طبق نیاز خود تغییر دهید.
ast-network-creating-new-site
پس از افزودن سایت، در داشبورد سایت در دسترس خواهد بود. برای دسترسی به همه سایتها، از داشبورد شبکه به sites > all sites بروید.
all-sites
افزودن تمها به Multisite
برای افزودن تمها به My Sites > Network Admin > Themes بروید. این صفحه تمام تمهای موجود در این شبکه چندسایتی را نمایش میدهد. با انتخاب گزینه «فعال کردن شبکه» در کنار یک تم، میتوانید آن تم را برای سایر وبسایتها قابل دسترسی کنید.
همچنین میتوان یک تم را با استفاده از لینک «غیرفعال کردن شبکه» که در زیر تم قرار دارد، غیرفعال کرد. لازم به ذکر است که گزینه غیرفعال کردن شبکه فقط در حالی که تم فعال است، ظاهر میشود.
ast-network-adding-themes
برای افزودن یک قالب جدید، میتوانید به سادگی روی دکمه «افزودن جدید» در بالا کلیک کنید، یک قالب را انتخاب کنید و آن را در شبکه چندسایتی نصب کنید.
استفاده از قالب فرزند آسترا
پس از اتمام تنظیمات، میتوانید از اینجا یک قالب فرزند ایجاد کنید. میتوانید قالبهای فرزند خود را مطابق با نیازهای خود شخصیسازی کنید و سپس آنها را به سادگی با آپلود کردن به شبکه چندسایتی اضافه کنید. پس از نصب قالب فرزند، لطفاً آنها را در شبکه فعال کنید تا در سراسر شبکه از آنها استفاده شود.
لطفاً توجه داشته باشید که هر قالب فرزند باید یک نام منحصر به فرد داشته باشد. هنگامی که قالب جدید را در شبکه چندسایتی آپلود میکنید، اگر از همان نام استفاده کنید، به جای ایجاد یک قالب فرزند جدید، قالب موجود جایگزین میشود.
نصب افزونهها در چندسایت
مشابه افزودن قالبها به چندسایت، میتوانید افزونهها را با رفتن به سایتهای من > مدیریت شبکه > افزونهها نصب کنید. این کار شما را به صفحه افزونهها هدایت میکند.
میتوانید افزونهها را در شبکه چندسایتی خود با کلیک روی گزینه «فعالسازی شبکه» در زیر هر افزونه فعال کنید. برای افزودن افزونه جدید، روی دکمه «افزودن افزونه» در بالا کلیک کنید، افزونه را انتخاب کرده و آن را نصب کنید.
افزودن افزونهها
همین! اگر با هر مشکلی مواجه شدید، با تیم پشتیبانی ما تماس بگیرید. ما اینجا هستیم تا به شما کمک کنیم.
How to Create a Multisite Network and Use Astra Child Theme On It
With the help of the multisite feature, you may control a network of websites from a single location. A network of several websites can be created and managed using this style of WordPress installation from a single WordPress dashboard.
This makes it simple to update all your websites and make changes from a single location. The number of websites can range from 2 to a few million. For example, WordPress uses this feature to maintain 37 million websites in the same place.
What is a Child Theme?
A child theme is the replica of the parent theme that inherits all the functionalities and styles from the parent theme. The main use of the child theme is to allow customization in the theme files.
Any changes you make to the theme files directly will be erased when you update the theme. Editing the theme files using the child theme ensures that the custom codes you use to edit the theme files will remain on your website even after you update the site’s theme.
Here is an article that can guide you through more details about the Astra Child theme.
User Roles
Network Administrator: When you create a multisite within your WordPress website, it makes you the network administrator of your site. It also allows your users to create their individual sites and be the admin for their respective sites.
Site admin: These users can create their own site inside of your multisite network; however, will not be able to install a new plugin while they can activate and use the plugins already installed by the network administrator.
The site admin has a lower level of access than the Network admin. The site admin can add new users and assign them roles as site admins; however, their access will be restricted to the site that they have been added to.
Domain Name
An important aspect of the multisite is that you can set up whether the sub-sites within your network can use sub-domains (example-site.mysite.com) or sub-directories (mysite.com/examplesite).
You can also map other domains to your network to provide the options for the sites within your network to have individual domain names.
How to Set Up and Activate Multisite
While using the Astra theme, you can use the child theme to set up as many sites as you would like within your WordPress installation. Here are the detailed steps on how to set up a multisite network using a child theme.
Please note that we recommend taking a solid backup of your website before enabling multisite features. Here is an article that will help you to back up your website.
Activating Multisite Feature
With every WordPress installation, the Multisite Network feature is pre-installed. All you have to do is set up and install WordPress as usual. You then only need to turn on the multisite feature.
Step 1: Downloading and Installing File Manager Plugin
Any WordPress website that already exists can have the multisite capability enabled. To enable Multisite, connect to your site using an FTP client or cPanel file manager, and open the wp-config.php file for editing.
In this example, we will use a plugin called File Manager which you can download from here. Download the plugin and upload it to your WordPress site and install and activate it.
ast-file-manager-plugin
Step 2: Editing wp-config.php file
Once you activate the plugin, find the wp.config.php file and right-click on it. This will open up a drop-down menu. Select code editor from the menu.
ast-plugin-file-manager-code-editor
Once the code editor opens, copy the following code and paste it into the code editor at the bottom. Click on save and close to save the changes.
define( 'WP_ALLOW_MULTISITE', true);
ast-plugin-file-manager-code-editor
Note: while editing the wpconfig.php file, please ensure that you paste the code above the text that says “/* That’s all, stop editing! Happy publishing. */”.
Your WordPress site’s multisite functionality is enabled with this code. Once enabled, the multisite network still has to be set up.
Setting Up a Multisite Network
Let’s configure the multisite network now:
Step 1: Disabling all Plugins
In the next step, You must deactivate all of your website’s plugins if you’re setting up a multisite network on an existing WordPress website. Navigate to Plugins > Installed Plugins and select all the plugins. Select deactivate on the bulk action option and click on Apply.
ast-dsiable-all-plugin
Step 2: Installing the Network Setup
Once all the plugins are disabled, navigate to Tools > Network Setup to configure the multisite network.
ast-tools-network-setup
On the network setup page, you will need to enter the name of the network and your email address. Please ensure that the email address that you have provided is correct. After that, click on the Install button at the bottom.
ast-network-set-up-install
Once you click on the install button, on the next screen, WordPress will display a few codes which you will need to add to the wpconfig.php and htaccess.php files.
You can edit the file similarly by navigating to the File Manager plugin, right-clicking on the respective files, selecting code editor, pasting the codes, and clicking on the Save and Close button.
ast-tools-network-setup-codes
Step 3: Network Dashboard
Once you have set up the network settings navigate to the Network Dashboard to make changes to the multisite. Click on My Sites on the top bar of your WordPress dashboard, select Network Admin, and click on Dashboard.
ast-network-admin
Once you have clicked on the dashboard, you will see the network dashboard and the “Right Now” dashboard. You can either create a new site and a new user or search for the existing sites or users.
Step 4: Configuring Network Settings
Once you can access the network administrator dashboard, click on Settings and choose Network Settings. This will open up the Network Settings options that you need to configure.
The most crucial setting in your network configuration is typically found in the ‘Registration Settings’ section of the network settings page. On the network, user and site registrations are disabled by default.
You have the option of allowing both site and user registration on your website, as well as allowing current users to build new sites.
This will allow you to add new sites to your multisite network.
Creating a New Site
On the network dashboard, click on the create a new site option to create a new site.
ast-network-create-new
You will need to enter the following information to create a new site.
Site Address (URL): This will be the name of your website followed by the main domain. For example, storyteller.wpastra.com. Here storyteller is the name of the website and wpastra.com is the main domain address.
Site Title: This is the title of the site which will be displayed on top of the dashboard.
Site Language: By default, the site title will be selected as English (United States). You can choose from the dropdown if you would like to change the language.
Admin Email: By default, this will display the email address that you entered earlier when creating the network. If you wish, you can also change it as per your requirements.
ast-network-creating-new-site
Once you add the site, it will be available on the site dashboard. To access all the sites, navigate to the sites > all sites from the network dashboard.
all-sites
Adding Themes to the Multisite
To add themes navigate to My Sites > Network Admin > Themes. This page will display all the available themes on this multisite network. By selecting the “Network Enable” option next to a theme, you can make that theme accessible to other websites.
A theme can also be turned off by using the “Network Disable” link located beneath the theme. It should be noted that the Network Disable option only appears while the theme is active.
ast-network-adding-themes
To add a new theme, you can simply click on the Add New button on the top, select a theme, and install it in the multisite network.
Using Astra Child Theme
Once you have completed the setup, you can generate a child theme from here. You can personalize your child’s themes according to your needs and then add them to the multisite network simply by uploading them. Once the child theme is installed, please Network Enable them to use them across the network.
Please take note that each child theme needs to have a unique name. When you upload the new theme to the multisite network, it will overwrite the existing one if you use the same name rather than generating a new child theme.
Installing Plugins to the Multisite
Similar to adding themes to the multisite, you can install plugins by navigating to My Sites > Network Admin > Plugins. This will redirect you to the plugins page.
You can activate the plugins on your multisite network by clicking the ‘Network Activate’ option beneath each plugin. To add a new plugin click the Add New button at the top, select the plugin, and install it.
adding-plugins
That’s all! If you encounter any issues, feel free to contact our support team. We’re here to assist you.
https://wpastra.com/docs/multisite-network-with-astra-child-theme/