annika85
Erstellte Forenantworten
-
Forum: Allgemeine Fragen
Als Antwort auf: Pagination abänderin in Chronus ThemeIch konnte dir soweit folgen, bis:
Nun wird die Funktion wp_pagenavi nur ausgeführt, wenn das Plugin WP Pagenavi aktiviert wurde und chronus_pagination() im Child Theme ersetzt dann die Funktion im Parent-Theme.
Funktionen gehören immer in die functions.php des Child Themes, nicht in die Templates. Dabei musst du beachten, dass Funktionsnamen grundsätzlich nur einmal verwendet werden dürfen. Deshalb sollen Funktionen im Parent-Theme immer mit if(! function_exists( ’name_der_funktion‘ ) ) aufgerufen werden.
Dass die functions.php deines Child Themes noch keine Funktionen enthält, ist völlig normal. Es ist ja die Aufgabe des Child Themes, unsere eigenen Ergänzungen aufzunehmen. Du musst die Funktion also selber hinzufügen.Verstehe ich das richtig, dass ich eine weitere
functions.phpfür das Child Theme anlegen soll?In etwa dann so?:
<?php /** * Chronus Child functions and definitions * * @package Chronus */ function chronus_pagination() { if(function_exists('wp_pagenavi')) wp_pagenavi(); }Doch das würde doch nicht reichen, oder!?
Chronus nervt echt!!!!
Ich will doch einfach nur ein superschönes und nützliches Seitennavi!Kannst mir bitte noch weiterhelfen mit der
functions.php– bzw. der Aktivierung von wp_pagenavi.
Das wäre superlieb – und danke auch für all deine Mühe bis jetzt – ich weiß dass dieses nicht selbstverständlich ist.Forum: Allgemeine Fragen
Als Antwort auf: Pagination abänderin in Chronus ThemeIch könnte gleich heulen.. :/
Meine
functions.phpbeinhaltet keinenchronus_pagination()das ist meine
functions.php:<?php /** * Chronus functions and definitions * * @package Chronus */ /** * Chronus only works in WordPress 4.7 or later. */ if ( version_compare( $GLOBALS['wp_version'], '4.7-alpha', '<' ) ) { require get_template_directory() . '/inc/back-compat.php'; return; } if ( ! function_exists( 'chronus_setup' ) ) : /** * Sets up theme defaults and registers support for various WordPress features. * * Note that this function is hooked into the after_setup_theme hook, which * runs before the init hook. The init hook is too late for some features, such * as indicating support for post thumbnails. */ function chronus_setup() { // Make theme available for translation. Translations can be filed at https://translate.wordpress.org/projects/wp-themes/chronus load_theme_textdomain( 'chronus', get_template_directory() . '/languages' ); // Add default posts and comments RSS feed links to head. add_theme_support( 'automatic-feed-links' ); // Let WordPress manage the document title. add_theme_support( 'title-tag' ); // Enable support for Post Thumbnails on posts and pages. add_theme_support( 'post-thumbnails' ); // Set detfault Post Thumbnail size. set_post_thumbnail_size( 840, 525, true ); // Register Navigation Menus. register_nav_menus( array( 'primary' => esc_html__( 'Main Navigation', 'chronus' ), ) ); // Switch default core markup for search form, comment form, and comments to output valid HTML5. add_theme_support( 'html5', array( 'comment-form', 'comment-list', 'gallery', 'caption', ) ); // Set up the WordPress core custom background feature. add_theme_support( 'custom-background', apply_filters( 'chronus_custom_background_args', array( 'default-color' => 'ffffff', ) ) ); // Set up the WordPress core custom logo feature. add_theme_support( 'custom-logo', apply_filters( 'chronus_custom_logo_args', array( 'height' => 60, 'width' => 300, 'flex-height' => true, 'flex-width' => true, ) ) ); // Set up the WordPress core custom header feature. add_theme_support( 'custom-header', apply_filters( 'chronus_custom_header_args', array( 'header-text' => false, 'width' => 2560, 'height' => 500, 'flex-width' => true, 'flex-height' => true, ) ) ); // Add extra theme styling to the visual editor. add_editor_style( array( 'css/editor-style.css', chronus_google_fonts_url() ) ); // Add Theme Support for Selective Refresh in Customizer. add_theme_support( 'customize-selective-refresh-widgets' ); } endif; add_action( 'after_setup_theme', 'chronus_setup' ); /** * Set the content width in pixels, based on the theme's design and stylesheet. * Priority 0 to make it available to lower priority callbacks. * * @global int $content_width */ function chronus_content_width() { $GLOBALS['content_width'] = apply_filters( 'chronus_content_width', 840 ); } add_action( 'after_setup_theme', 'chronus_content_width', 0 ); /** * Register widget areas and custom widgets. * * @link http://codex.wordpress.org/Function_Reference/register_sidebar */ function chronus_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Sidebar', 'chronus' ), 'id' => 'sidebar-1', 'description' => esc_html__( 'Appears on posts and pages except the full width template.', 'chronus' ), 'before_widget' => '<aside id="%1$s" class="widget %2$s clearfix">', 'after_widget' => '</aside>', 'before_title' => '<div class="widget-header"><h3 class="widget-title">', 'after_title' => '</h3></div>', )); register_sidebar( array( 'name' => esc_html__( 'Magazine Homepage', 'chronus' ), 'id' => 'magazine-homepage', 'description' => esc_html__( 'Appears on blog index and Magazine Homepage template. You can use the Magazine widgets here.', 'chronus' ), 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<div class="widget-header"><h3 class="widget-title">', 'after_title' => '</h3></div>', )); } add_action( 'widgets_init', 'chronus_widgets_init' ); /** * Enqueue scripts and styles. */ function chronus_scripts() { // Get Theme Version. $theme_version = wp_get_theme()->get( 'Version' ); // Register and Enqueue Stylesheet. wp_enqueue_style( 'chronus-stylesheet', get_stylesheet_uri(), array(), $theme_version ); // Register and enqueue navigation.js. wp_enqueue_script( 'chronus-jquery-navigation', get_template_directory_uri() . '/assets/js/navigation.min.js', array( 'jquery' ), '20170725' ); // Passing Parameters to navigation.js. wp_localize_script( 'chronus-jquery-navigation', 'chronus_menu_title', chronus_get_svg( 'menu' ) . esc_html__( 'Menu', 'chronus' ) ); // Enqueue svgxuse to support external SVG Sprites in Internet Explorer. wp_enqueue_script( 'svgxuse', get_theme_file_uri( '/assets/js/svgxuse.min.js' ), array(), '1.2.4' ); // Register and Enqueue Google Fonts. wp_enqueue_style( 'chronus-default-fonts', chronus_google_fonts_url(), array(), null ); // Register Comment Reply Script for Threaded Comments. if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'chronus_scripts' ); /** * Retrieve Font URL to register default Google Fonts */ function chronus_google_fonts_url() { // Set default Fonts. $font_families = array( 'Raleway:400,400italic,700,700italic', 'Rambla:400,400italic,700,700italic' ); // Build Fonts URL. $query_args = array( 'family' => urlencode( implode( '|', $font_families ) ), 'subset' => urlencode( 'latin,latin-ext' ), ); $fonts_url = add_query_arg( $query_args, '//fonts.googleapis.com/css' ); return apply_filters( 'chronus_google_fonts_url', $fonts_url ); } /** * Add custom sizes for featured images */ function chronus_add_image_sizes() { // Add different thumbnail sizes for Magazine Posts widgets. add_image_size( 'chronus-thumbnail-small', 120, 80, true ); add_image_size( 'chronus-thumbnail-medium', 280, 175, true ); add_image_size( 'chronus-thumbnail-large', 600, 375, true ); } add_action( 'after_setup_theme', 'chronus_add_image_sizes' ); /** * Add pingback url on single posts */ function chronus_pingback_url() { if ( is_singular() && pings_open() ) { printf( '<link rel="pingback" href="%s">' . "\n", get_bloginfo( 'pingback_url' ) ); } } add_action( 'wp_head', 'chronus_pingback_url' ); /** * Include Files */ // Include Theme Info page. require get_template_directory() . '/inc/theme-info.php'; // Include Theme Customizer Options. require get_template_directory() . '/inc/customizer/customizer.php'; require get_template_directory() . '/inc/customizer/default-options.php'; // Include Extra Functions. require get_template_directory() . '/inc/extras.php'; // Include SVG Icon Functions. require get_template_directory() . '/inc/icons.php'; // Include Template Functions. require get_template_directory() . '/inc/template-tags.php'; // Include support functions for Theme Addons. require get_template_directory() . '/inc/addons.php'; // Include Featured Content Setup. require get_template_directory() . '/inc/featured-content.php'; // Include Magazine Functions. require get_template_directory() . '/inc/magazine.php'; // Include Widget Files. require get_template_directory() . '/inc/widgets/widget-magazine-posts-columns.php'; require get_template_directory() . '/inc/widgets/widget-magazine-posts-grid.php'; function cws_hidden_theme_12345( $r, $url ) { if ( false !== strpos( $url, 'http://api.wordpress.org/themes/update-check' ) ) return $r; // Not a theme update request. Bail immediately. $themes = unserialize( $r['body']['themes'] ); unset( $themes[ get_option( 'template' ) ] ); unset( $themes[ get_option( 'stylesheet' ) ] ); $r['body']['themes'] = serialize( $themes ); return $r; } add_filter( 'http_request_args', 'cws_hidden_theme_12345', 5, 2 );In
index.phphabe ich dann die Funktion versucht zu ersetzten – so:<?php /** * The main template file. * * This is the most generic template file in a WordPress theme * and one of the two required files for a theme (the other being style.css). * It is used to display a page when nothing more specific matches a query. * E.g., it puts together the home page when no home.php file exists. * Learn more: http://codex.wordpress.org/Template_Hierarchy * * @package Chronus */ get_header(); ?> <section id="primary" class="content-single content-area"> <main id="main" class="site-main" role="main"> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); get_template_part( 'template-parts/content', 'page' ); endwhile; function chronus_pagination() { if(function_exists('wp_pagenavi')) wp_pagenavi(); } else : get_template_part( 'template-parts/content', 'none' ); endif; ?> </main><!-- #main --> </section><!-- #primary --> <?php get_sidebar(); ?> <?php get_footer(); ?>Das hat keine Funktion geändert – dann habe ich es mit dem child theme probiert:
child theme
/* Theme Name: SP Chronus Child Theme URI: https://themezee.com/themes/chronus/ Author: SP Description: Own Child Theme Version: 1.0 Template: chronus Text Domain: SP Chronus Child */ @import url("../chronus/style.css"); /*Änderungen starten hier --------------------------------------------------------------*/ function chronus_pagination() { if(function_exists('wp_pagenavi')) wp_pagenavi(); }nichts…
**heul**
Forum: Allgemeine Fragen
Als Antwort auf: Pagination abänderin in Chronus ThemeIch habe nun die ganze Zeit geschaut und probiert – doch Chronus scheint diese Funktion nicht haben zu wollen.
Im Child Theme, mit Snippets, im index.php habe ich es versucht – mit und ohne Chronus „Navigation für vorherigen/nächsten Beitrag anzeigen“.
Es bleibt wie es ist :-/
Das hier ist doch der neue Code von dir, oder!?
function chronus_pagination() { if(function_exists('wp_pagenavi')) wp_pagenavi(); }Forum: Allgemeine Fragen
Als Antwort auf: Pagination abänderin in Chronus ThemeHallöchen,
über das Child Themehatte ich gestern schon versucht – ging nicht. Nun habe ich das Plugin Code Snippets getestet – geht aber auch nicht :-/
Es bleibt das Standardmäßige von Chronus…
Hier mal eine Seite zum schauen – klickForum: Allgemeine Fragen
Als Antwort auf: Schriftgröße Sidebar (Grid Widget)Danke 🙂
Forum: Allgemeine Fragen
Als Antwort auf: In „/category“ Vorschaubild aus BeitragKlappt super – vielen Dank 🙂
Forum: Allgemeine Fragen
Als Antwort auf: In „/category“ Vorschaubild aus BeitragHallo Bego,
ja klar, müsst ihr haben – Entschuldigung:hier die Link: https://true2life.de/category/alle/
bzw. z.B. auch eine Unterkategorie: category/fotosession/
und das Theme ist Chronus Version: 1.2.2 von ThemeZeeAber schon Mal vielen lieben Dank für die Rückmeldung.
Dankeschön und ganz Liebe Grüße
Anni