"; var_dump( $str ); echo ""; } } /** * Breadcrumbs apply */ if ( ! function_exists( 'octane_breacrumbs' ) ) { function octane_breacrumbs() { if ( function_exists( 'bcn_display' ) ) { $breadcrumb = Octane_Theme_Options::get_option( 'field-breadcrumb-type' ); if ( ! empty( $breadcrumb ) && $breadcrumb !== "none" ) { ?> found_posts ) { return false; } } return true; } } add_filter( 'bcn_settings_init', 'octane_breadcrumb_trail' ); /** * Change Breadcrum seperator to theme * * @param $trail * * @return mixed */ function octane_breadcrumb_trail( $trail ) { $seperator = Octane_Theme_Options::get_option( 'field-breadcrumb-seperator' ); if ( ! empty( $seperator ) ) { $trail['hseparator'] = '' . $seperator . ''; } return $trail; } /** * Display type of layout for the content * * @param string $default * * @return mixed */ function octane_content_layout_type() { $page_layout = Octane_Theme_Options::get_option( 'field-global-page-layout-selection' ); $blog_layout = Octane_Theme_Options::get_option( 'field-global-blog-layout-selection' ); $archive_layout = Octane_Theme_Options::get_option( 'field-global-archives-layout-selection' ); $global_layout = Octane_Theme_Options::get_option( 'field-global-layout-selection' ); //For pages and single pages if ( is_front_page() && ! empty( $global_layout ) ) { $default = octane_get_content_layout( $global_layout ); } else if ( is_page() && ! empty( $page_layout ) ) { $default = octane_get_content_layout( $page_layout ); } else if ( ( is_home() || is_single() ) && ! empty( $blog_layout ) ) { //For Blog pages and single blog pages $default = octane_get_content_layout( $blog_layout ); } else if ( ( is_archive() || is_search() ) && ! empty( $archive_layout ) ) { //For Blog pages and single blog pages $default = octane_get_content_layout( $archive_layout ); } else { if ( ! empty( $global_layout ) ) { $default = octane_get_content_layout( $global_layout ); } } return $default; } /** * Get Type of content and output class accordingly * * @param $layout * * @return mixed */ function octane_get_content_layout( $layout ) { if ( ! empty( $layout ) && $layout === "full-width" ) { //If page is built with elemetnor change class to sth else to suit $args = 'container-fluid'; } else { $args = 'boxed'; } return apply_filters( 'octane_content_layout_option', $args ); } function octane_excerpt_more( $more ) { if ( ! is_admin() && is_home() ) { $text = Octane_Theme_Options::get_option( 'field-blog-read-more' ); $more = sprintf( '%2$s', get_permalink( get_the_ID() ), esc_html( $text ) ); } return $more; } add_filter( 'excerpt_more', 'octane_excerpt_more' ); function octane_excerpt_length( $length ) { if ( ! is_admin() && is_home() ) { $length = Octane_Theme_Options::get_option( 'field-blog-excerpt-length' ); } return $length; } add_filter( 'excerpt_length', 'octane_excerpt_length', 999 ); function octane_features_plugin_is_active() { /** * Detect plugin. For use on Front End only. */ include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); // check for plugin using plugin name if ( is_plugin_active( 'octane-features/octane-features.php' ) ) { return true; } else { return false; } } function octane_content_type( $more_content_type ) { $content_type = array( 'post' => esc_html__( 'Post', 'octane' ), 'page' => esc_html__( 'Page', 'octane' ), 'category' => esc_html__( 'Category', 'octane' ), 'custom' => esc_html__( 'Custom', 'octane' ), ); if( octane_features_plugin_is_active() ) { if( 'portfolio' === $more_content_type ) { $content_type['portfolio'] = esc_html__( 'Portfolio', 'octane' ); } elseif( 'service' === $more_content_type ) { $content_type['service'] = esc_html__( 'Service', 'octane' ); } elseif( 'team' === $more_content_type ) { $content_type['team'] = esc_html__( 'Team', 'octane' ); } } return $content_type; }