This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_action( 'wp', 'initial_page_builder_action_with_learndash' ); | |
| // Remove Astra Page builder compatbility for learndash single post-types. | |
| function initial_page_builder_action_with_learndash(){ | |
| if ( class_exists( 'SFWD_LMS' ) ) { | |
| if ( is_singular( 'sfwd-courses' ) || is_singular( 'sfwd-lessons' ) || is_singular( 'sfwd-topic' ) || is_singular( 'sfwd-quiz' ) || is_singular( 'sfwd-certificates' ) || is_singular( 'sfwd-assignment' ) ) { | |
| add_filter( 'astra_enable_page_builder_compatibility', '__return_false' ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** No Sidebar On All Posts In A Category (Uses Category I.D*/ | |
| add_filter( 'astra_page_layout', 'no_sidebar_specific_categories' ); | |
| /** | |
| * @link https://codex.wordpress.org/Conditional_Tags | |
| */ | |
| function no_sidebar_specific_categories( $sidebar ){ | |
| // Replace below category ID 1, 2, or 3 as your requirement. | |
| if ( in_category( array( 1,2,3 ) ) ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Add Default Previuos / Next lesson pagination to the lesson template of Lifter LMS | |
| */ | |
| add_action( 'wp', 'add_lifter_lesson_navigation' ); | |
| function add_lifter_lesson_navigation(){ | |
| if ( class_exists( 'LifterLMS' ) ) { | |
| if ( is_lesson() ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * The template for displaying comments. | |
| * | |
| * This is the template that displays the area of the page that contains both the current comments | |
| * and the comment form. | |
| * | |
| * @link https://codex.wordpress.org/Template_Hierarchy | |
| * | |
| * @package Astra |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Disable Author Archive link from Post Meta. | |
| */ | |
| add_filter( 'astra_post_author', 'your_author_meta_update' ); | |
| function your_author_meta_update( $output ){ | |
| $author_info = sprintf( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Add "Read More" link to excerpts only (Excerpts which are the hand-crafted summaries of your content )) | |
| add_filter('get_the_excerpt', 'custom_excerpt_read_more_link'); | |
| function custom_excerpt_read_more_link($excerpt) { | |
| $excerpt_more = ''; | |
| $read_more_text = 'Read More »'; | |
| if ( has_excerpt() && ! is_attachment() && get_post_type() == 'post' ) { | |
| $excerpt_more = '<p class="read-more" ><a href="' . esc_url( get_permalink() ) . '"> '. $read_more_text . '</a></p>'; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Add Last Update date just after the Published date in post meta. | |
| */ | |
| add_filter( 'astra_post_date', 'add_modified_date_to_post_meta' ); | |
| function add_modified_date_to_post_meta( $output ){ | |
| $modified_date = esc_html( get_the_modified_date() ); | |
| $original_time = get_the_time('U'); | |
| $modified_time = get_the_modified_time('U'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** Default Blog / Archive and Single Blog Post sidebar applied to the Custom Post Type */ | |
| add_filter( 'astra_page_layout', 'custom_post_type_custom_sidebar' ); | |
| /** | |
| * @link https://codex.wordpress.org/Conditional_Tags | |
| */ | |
| function custom_post_type_custom_sidebar( $sidebar ){ | |
| $blog_archive_sidebar = astra_get_option('archive-post-sidebar-layout'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Disable title on all pages and posts. | |
| */ | |
| function your_prefix_post_title() { | |
| $post_types = array( 'page', 'post' ); | |
| // bail early if the current post type if not the one we want to customize. | |
| if ( ! in_array( get_post_type(), $post_types ) ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Register a new image size. | |
| * | |
| * @link https://developer.wordpress.org/reference/functions/add_image_size/ | |
| * | |
| * your-custom-size -- Image size identifier | |
| * 940 -- width of the image size as per your requirement. | |
| * 540 -- width of the image size as per your requirement. |