Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Exit if accessed directly
- if ( !defined( 'ABSPATH' ) ) exit;
- // BEGIN ENQUEUE PARENT ACTION
- // AUTO GENERATED - Do not modify or remove comment markers above or below:
- if ( !function_exists( 'chld_thm_cfg_locale_css' ) ):
- function chld_thm_cfg_locale_css( $uri ){
- if ( empty( $uri ) && is_rtl() && file_exists( get_template_directory() . '/rtl.css' ) )
- $uri = get_template_directory_uri() . '/rtl.css';
- return $uri;
- }
- endif;
- add_filter( 'locale_stylesheet_uri', 'chld_thm_cfg_locale_css' );
- if ( !function_exists( 'chld_thm_cfg_parent_css' ) ):
- function chld_thm_cfg_parent_css() {
- wp_enqueue_style( 'chld_thm_cfg_parent', trailingslashit( get_template_directory_uri() ) . 'style.css', array( ) );
- }
- endif;
- add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_parent_css', 10 );
- add_action('init', function(){
- register_taxonomy_for_object_type( 'category', 'page' );
- });
- add_action('wp_enqueue_scripts', function() {
- if ( is_page()) :
- $template = get_post_meta( get_queried_object_id(), '_wp_page_template', true );
- if ('child-page.php' == $template ) {
- //wp_enqueue_script('masonry-jquery');
- }
- endif;
- });
- // END ENQUEUE PARENT ACTION
- /**
- * get_more_excerpt()
- * Replacement for get_the_content() that always only returns excerpts before
- * any <!--more--> tags regardless of context. Otherwise returns all content.
- * Must be used in "The Loop".
- * WARNING! Password protected posts are not protected with this function.
- */
- function get_more_excerpt() {
- global $post;
- $content = $post->post_content;
- // set link text here VVVV
- $more_link_text = '(Weiterlesen …)';
- $output = '';
- if ( preg_match( '/<!--more(.*?)?-->/', $content, $matches )) {
- if ( has_block( 'more', $content ) ) {
- // Remove the core/more block delimiters. They will be left over after $content is split up.
- $content = preg_replace( '/<!-- \/?wp:more(.*?) -->/', '', $content );
- }
- $content = explode( $matches[0], $content, 2 );
- $has_more = true;
- } else {
- $content = array( $content );
- $has_more = false;
- }
- $output .= $content[0];
- if ( $has_more ) {
- $output .= ' <a href="' . get_permalink( $post ) . "#more-{$post->ID}\" class=\"more-link\">$more_link_text</a>";
- $output = force_balance_tags( $output );
- }
- return apply_filters('the_content', $content );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement