Disable featured image on all pages

Disable featured image on all pages

Astra has a filter astra_featured_image_enabled which can be used to programmatically enable or disable the featured image.

Here is an example snippet that shows how you can disable the featured image on all the pages by default.

/**
* Disable featured images for pages.
* Set the featured image to false if current post type is 'page'
*
* @param boolean $status True - Enable featured image; False - Disable featured image
* @return boolean Featured image status based on the
*/
function disable_feattured_image_for_posts( $status ) {

// disable featured image for pages.
if ( 'page' == get_post_type() ) {
$status = false;
}

return $status;
}

add_filter( 'astra_featured_image_enabled', 'disable_feattured_image_for_posts' );

Note:

Add the above code into the child theme』s functions.php file.

White Label Constants to Change Strings Permanently

White Label Constants to Change Strings Permanently

We all know how to White Label Astra? It is also known that the white label settings page can be hidden from the dashboard. However, it reappears when the plugin is re-activated on the website.

We were asked whether these white label settings can be hidden permanently. Especially agencies who serve many clients would not want them to know that the plugin or theme used to build their website is a third party white labeled plugin.

Therefore, we』ve introduced a method that will allow you to White Label the Astra and hide the White Label settings – and keep them hidden, no matter what activity the user performs with the plugin or on the website. This means that you can white label the Astra permanently from the wp-config.php file and these settings will not be changed from the WordPress dashboard settings.

To achieve the above scenario we have added a White Label Constants to Astra. Along with Astra theme and Astra Pro plugin, you get contact for Astra related plugins as well.

Below is the list for the White Label Settings and their respective White Label Constants

# Astra Theme and Astra Pro Plugin

White Label Settings
White Label Constants

Agency Author Name
AST_WL_ASTRA_AGENCY_AUTHOR

Agency Author URL
AST_WL_ASTRA_AGENCY_AUTHOR_URL

Agency License URL
AST_WL_ASTRA_AGENCY_LICENCE

Astra Theme Name
AST_WL_ASTRA_NAME

Astra Theme Description
AST_WL_ASTRA_DESCRIPTION

Astra Theme Screenshot
AST_WL_ASTRA_SCREENSHOT

Astra Pro Name
AST_WL_ASTRA_PRO_NAME

Astra Pro Description
AST_WL_ASTRA_PRO_DESCRIPTION

# Starter Templates plugin or Astra Premium Sites plugin (available with Astra Essential Bundle and Growth Bundle)

White Label Settings
White Label Constants

Astra Sites Name
AST_WL_ASTRA_SITES_NAME

Astra Sites Description
AST_WL_ASTRA_SITES_DESCRIPTION

# Lightweight Sidebar Manager Plugin

White Label Settings
White Label Constants

Sidebar Manager Name
AST_WL_BSF_LW_SB_NAME

Sidebar Manager Description
AST_WL_BSF_LW_SB_DESCRIPTION

# Astra Hooks Plugin

White Label Settings
White Label Constants

Astra Hooks Name
AST_WL_ASTRA_HOOKS_DESCRIPTION

Astra Hooks Description
WP_UAEL_WL

# Custom Fonts Plugin

White Label Settings
White Label Constants

Custom Fonts Name
AST_WL_BSF_CUSTOM_FONTS_NAME

Custom Fonts Description
AST_WL_BSF_CUSTOM_FONTS_DESCRIPTION

# Adobe Fonts (Custom Typekit Fonts)

White Label Settings
White Label Constants

Adobe Fonts Name
AST_WL_CUSTOM_TYPEKIT_FONTS_NAME

Adobe Fonts Description
AST_WL_CUSTOM_TYPEKIT_FONTS_DESCRIPTION

How to use White Label Constants?

Step 1 – Open and edit the wp-config.php file.Step 2 –  Find the line /* That』s all, stop editing! Happy blogging. */ and add White Label Constants code just before this line.Step  3 – Below is the sample code for the White Label Constants. You can update the strings as per your requirement.

define( 'AST_WL_ASTRA_AGENCY_AUTHOR', 'Agency Author' );
define( 'AST_WL_ASTRA_AGENCY_AUTHOR_URL', 'www.your-website-url.com' );
define( 'AST_WL_ASTRA_AGENCY_LICENCE', 'www.your-get-licence-url.com' );
define( 'AST_WL_ASTRA_NAME', 'Fastest WP Theme' );
define( 'AST_WL_ASTRA_DESCRIPTION', 'WordPress theme' );
define( 'AST_WL_ASTRA_SCREENSHOT', 'www.your-theme-screenshot-url.com' );
define( 'AST_WL_ASTRA_PRO_NAME', 'Pro Addon' );
define( 'AST_WL_ASTRA_PRO_DESCRIPTION', 'Pro Addon extends the features of theme' );
define( 'AST_WL_ASTRA_SITES_NAME', 'Ready Sites' );
define( 'AST_WL_ASTRA_SITES_DESCRIPTION', 'Library of Ready sites' );
define( 'AST_WL_BSF_LW_SB_NAME', 'Custom Sidebar Manager' );
define( 'AST_WL_BSF_LW_SB_DESCRIPTION', 'Manage your Sidebar' );
define( 'AST_WL_ASTRA_HOOKS_NAME', 'Hooks for theme' );
define( 'AST_WL_ASTRA_HOOKS_DESCRIPTION', 'Use hooks to put custom code' );
define( 'AST_WL_BSF_CUSTOM_FONTS_NAME', 'My Custom Fonts' );
define( 'AST_WL_BSF_CUSTOM_FONTS_DESCRIPTION', 'Add custom fonts' );
define( 'AST_WL_CUSTOM_TYPEKIT_FONTS_NAME', 'My fonts' );
define( 'AST_WL_CUSTOM_TYPEKIT_FONTS_DESCRIPTION', 'Add custom typekit font' );

Checkout Page – EDD Module Options

Checkout Page – EDD Module Options

This is a premium feature available with Astra Pro Addon plugin. To use this Pro feature, you need to have the Astra theme along with the Astra Pro Addon installed on your website.

Read about the module here. Make sure that the Easy Digital Downloads Module is activated from Astra Options.

Before that please verify if you have the Easy Digital Downloads plugin installed and activated.

You can find the settings under Appearance > Customize > Easy Digital Downloads > Checkout Page

Following options are available-

Display Apply Coupon Field: Coupon field will be visible at the top of the checkout page. If you don』t want want to display any system for coupons you can disable it.Distraction Free Checkout: When you enable this option, the menu in the header and the first footer of the website will disappear on the checkout page. The option of Distraction Free Checkout overrides the header and footer settings.Checkout Form Width: Let the form width be default or using the Custom option set the custom width for the form.

How to Add RTL CSS via Child Theme?

How to Add RTL CSS via Child Theme?

Need to add custom CSS for RTL site? Usually, many of us add .rtl CSS class while writing a custom CSS for RTL site. These CSS loads even if we view the LTR site. Well, this is not a recommended way. In this article, you can explore how custom CSS can be added to the RTL site.

It is recommended to add custom code via a child theme. So make sure you have the Astra child theme installed and activated. Login with FTP and edit Astra child theme Create a new file and name it as rtl.css and add all custom CSS in this fileEdit functions.php file in child theme and add the following code snippet

/**
* Load the parent rtl.css file
*/
function astra_child_enqueue_rtl_styles() {
if ( is_rtl() ) {
// Load RTL CSS.
wp_enqueue_style( 'astra-rtl', get_stylesheet_directory_uri() . '/rtl.css', array('astra-theme-css'), ASTRA_THEME_VERSION );
}
}
add_action( 'wp_enqueue_scripts', 'astra_child_enqueue_rtl_styles' );

Check out the doc that explains how to add custom PHP code using the child theme』s functions.php file. 

Above code snippet will load RTL CSS only when the site is viewed in RTL mode. CSS will not load in LTR mode.

Does White Label Feature Make Changes in the Code?

Does White Label Feature Make Changes in the Code?

The function of a white label in Astra is to just remove the Astra branding from the dashboard, and it does not change any code.

If we remove the mentions of Astra from the code, even WordPress will not understand that the Astra theme is being used and so it will not detect any updates we release in the future.

However, there are some plugins that take a different approach and can help you white label WordPress itself completely. Hide My WP Ghost plugin is an example of this. If you need to white label your website completely, you can consider similar plugins.

Naming Convention for Astra 2.1.0 CSS File(s)

Naming Convention for Astra 2.1.0 CSS File(s)

Astra with version 2.1.0 offers an option of CSS file generation. In this article, you will see how these CSS files are named.

The new naming convention is really simple, so you don』t get confused when looking at these files.

The CSS file is named based on the post(s) or page(s) on your website. The Post ID or the Page ID will be used as a suffix at the end of the CSS file.

Let』s say you have a post and it』s ID it 「206」.

Then the CSS file will auto-generate with this name:

「astra-theme-dynamic-css-post-206.css」  (for Astra Theme)「astra-addon-dynamic-css-post-206.css」 (for Astro Pro)

New Typography Improvement for Astra

New Typography Improvement for Astra

Astra version 1.5.2 introduces a new typography param. With this user can select multiple font variants to be enqueued for base typography. That means the user can select different required Font Variant in Base Typography and use them on the entire site as per the requirement.

The settings can be found in the customizer under Global > Typography > Base Typography. After selecting a font-family, Font Variant option will appear. Select the required font variant. You can choose more than one variant.

Note: 

Font Variant option is available only for Base Typography.Font Variant option is available only for Google Fonts.

As shown in the above video, if you select font family as Poppins and select variant 400 Normal and Bold 700. Whenever you mark text as bold, it will be applied with Bold 700 font weight. These variants will be available with page builder as well.

Along with Font Variant option, typography param introduces an option that allows to search font-family from the lists. It can be seen in the above video. This is available for all typography settings.

Manually Install Astra via FTP

Manually Install Astra via FTP

Sometimes you might not able to install the Astra theme via the WordPress dashboard. In such a case, try installing the theme via FTP.

Below are the detailed steps –

Step 1 – Download Astra theme』s zip from WordPress repository Step 2 – Unzip the Astra theme zip fileStep 3 – Open your WordPress site via FTP. We would recommend you to use FileZilla Step 4 – From FTP, visit the root of the WordPress install Step 5 – Now visit wp-content folder > themes Step 6 – Upload Astra unzipped file from step 2

Step 7 – Now the Astra is installed on your site. Go to WordPress Dashboard and activate it from Appearance > Themes

Product Archive – EDD Module Options

Product Archive – EDD Module Options

This is a premium feature available with Astra Pro Addon plugin. To use this Pro feature, you need to have the Astra theme along with the Astra Pro Addon installed on your website.

Also, make sure that you have the Easy Digital Downloads plugin installed and activated.

Read about the module here. Make sure that the Easy Digital Downloads Module is activated from Astra Pro options.

You can style the product archive page where all your products are listed.

You can find the settings under Appearance > Customize > Easy Digital Downloads > Product Archive.

Below are the available options in the module –

1. Choose Product Style – Layout

Astra has two layout options for your Shop page:

Grid View: Where you can display your product archive page in a grid style, where the product image is displayed at the top. Product related information like price, category, title etc is displayed below the image.List View: Where the image and product related information is displayed side by side.

2. Archive Columns

You can choose the number of columns to be displayed for your products on the shop page, in Grid View and List View. You can choose the number of columns on your responsive devices with the toggle button.

3. Display Page Title

Enabling this option will display the title for the archive pages.

4. Product Structure

Product structure helps you in giving quick details in a simple and easy way. You can hide or display them by clicking on the 『eye』 icon.

5. Cart Button Text

Change the text for the Add To Cart button.

6. Variable Product Button

Choose a button or option for the variable product.

7. Variable Product Button Text

Change the text for the Variable Product Button text.

8. Product Styling

Content Alignment: This option helps you to set the overall alignment of the product view. You can set the content alignment to Left, Right or CenterBox Shadow and Box Hover Shadow: Shadows help in enhancing your product page design. You can add shadow for a box as well as for the mouse rollover.

8. Button

This helps you to set the horizontal and vertical padding for Add To Cart button.

9. Archive Content Width

Adjust the width specifically for product archive pages.

10. Colors

You can set the Colors for the Product Title, Price Color, and Content Color.

11. Typography

You can set the Typography for the Product Title, Product Price, Product Content from here.

How to Display a Breadcrumb Anywhere within a Page or Post with Shortcode?

How to Display a Breadcrumb Anywhere within a Page or Post with Shortcode?

From version 1.8.0, we have introduced a built-in breadcrumb feature into the Astra theme.

This allows you to display breadcrumbs and manage its styling through color and typography options.

Here is an article that will brief you on how you can add breadcrumbs using the Astra theme and document too.

The above method focuses on three default positions – viz. inside the header, below the header and above the title.

But, what if you want to display it anywhere on the page or post? All you need to do is paste a shortcode and you see it there!

This is the shortcode – [astra_breadcrumb]

Note: To use the Breadcrumb shortcode anywhere on the page, you will need the Astra Pro plugin installed and activated.

You can add this to any custom layout or just anywhere – maybe the header, the footer, sidebar widget, within a page builder widget, etc.