Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* Add the child theme setup function to the 'after_setup_theme' hook. */
- add_action( 'after_setup_theme', 'prototype_child_theme_setup', 11 );
- /**
- * Setup function. All child themes should run their setup within this function. The idea is to add/remove
- * filters and actions after the parent theme has been set up. This function provides you that opportunity.
- *
- * @since 0.1.0
- */
- function prototype_child_theme_setup() {
- /* Get the theme prefix ("prototype"). */
- $prefix = hybrid_get_prefix();
- /* Example action. */
- // add_action( "{$prefix}_header", 'prototype_child_example_action' );
- /* Example filter. */
- // add_filter( "{$prefix}_site_title", 'prototype_child_example_filter' );
- add_filter( 'the_content_more_link', 'remove_more_link_scroll' );
- //removing and improving the excerpt
- remove_filter('get_the_excerpt', 'wp_trim_excerpt');
- add_filter('get_the_excerpt', 'improved_trim_excerpt');
- //allow shortcodes in text widgets
- add_filter('widget_text', 'do_shortcode');
- add_action ( 'gettext', 'my_em_text_rewrites', 1, 3 );
- add_shortcode('location_group', 'em_location_by_region');
- }
- function remove_more_link_scroll( $link ) {
- $link = preg_replace( '|#more-[0-9]+|', '', $link );
- return $link;
- }
- /*improve the excerpt, keep HTML in there*/
- function improved_trim_excerpt($text) {
- global $post;
- if ( '' == $text ) {
- $text = get_the_content('');
- $text = apply_filters('the_content', $text);
- $text = str_replace(']]>', ']]>', $text);
- /*uncomment to strip javascript*/
- $text = preg_replace('@<script[^>]*?>.*?</script>@si', '', $text);
- $text = strip_tags($text, '<p><a><img><ul><ol><li>[php][css][text][perl][shell]');
- $excerpt_length = 500;
- $words = explode(' ', $text, $excerpt_length + 1);
- if (count($words)> $excerpt_length) {
- array_pop($words);
- array_push($words, '[...]');
- $text = implode(' ', $words);
- }
- }
- return $text;
- }
- function my_em_text_rewrites($translation, $orig, $domain) {
- str_replace('Send your booking','Anmelden', $translation);
- return $translation;
- }
- function em_location_by_region(){
- $args = array();
- $arr_location = EM_Locations::get($args);
- foreach( $arr_location as $EM_Location ){
- if ( !empty($EM_Location->location_name) ){
- echo "<h2>".$EM_Location->location_name."</h2>";
- echo do_shortcode('[events_list_grouped mode="monthly" location="'.$EM_Location->location_id.'"]');
- echo "<br/>---------------------------------------------------------------------------------------------------<br/>";
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement