Bin am verzweifeln! Texte auf der Startseite komplett anzeigen.

  • Guten Morgen,
    ich hoffe mir kann hier jemand helfen. Ich habe eine Seite die über Wordpress läuft und auf der Startseite werden die Artikel irgendwann abgekürzt und man muss klicken zum weiterlesen. Das sieht natürlich sehr blöd aus, so ein weißer Teil auf der Startseite. Ich weiß das das bei Artikeln so üblich ist, aber kann man da nicht irgendwas machen?? War schon im Code und habe nach ein paar Sachen geguckt was ich so bei google gefunden haben. Ich bin nur totaler Anfänger und habe null Ahnung davon:cry:
    Ich kopiere hier mal den theme code rein eventuell hilft das.Ich hoffe Ihr könnt mir helfen, ich verzweifel gerade:cry: Daaaanke

    <?php
    /**
    * web2feel functions and definitions
    *
    * @package web2feel
    */


    include ( 'getplugins.php' );
    include ( 'aq_resizer.php' );
    include ( 'guide.php' );


    /* Custom style */


    function custom_style() {
    $main_color = of_get_option('w2f_primary_color');
    $link_color = of_get_option('w2f_link_color');
    $hover_color = of_get_option('w2f_hover_color');
    ?>
    <style type="text/css">

    .top-feature,.main-navigation ul > li a:hover,h1.widget-title, h3.sidetitl,#side-tab{ background: <?php echo $main_color ?>; }
    a,a:visited{ color:<?php echo $link_color ?>;}
    a:hover,a:focus,a:active { color:<?php echo $hover_color ?>; }

    </style>
    <?php }


    add_action( 'wp_footer', 'custom_style' );


    /* Theme updater */
    require 'updater.php';
    $example_update_checker = new ThemeUpdateChecker(
    'Yegor', //Theme folder name, AKA "slug".
    'http://www.fabthemes.com/versions/yegor.json' //URL of the metadata file.
    );


    /**
    * Set the content width based on the theme's design and stylesheet.
    */
    if ( ! isset( $content_width ) )
    $content_width = 640; /* pixels */


    if ( ! function_exists( 'web2feel_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 post thumbnails.
    */
    function web2feel_setup() {


    /**
    * Make theme available for translation
    * Translations can be filed in the /languages/ directory
    * If you're building a theme based on web2feel, use a find and replace
    * to change 'web2feel' to the name of your theme in all the template files
    */
    load_theme_textdomain( 'web2feel', get_template_directory() . '/languages' );


    /**
    * Add default posts and comments RSS feed links to head
    */
    add_theme_support( 'automatic-feed-links' );


    /**
    * Enable support for Post Thumbnails on posts and pages
    *
    * Link http://codex.wordpress.org/Function_Refer…Post_Thumbnails
    */
    add_theme_support( 'post-thumbnails' );


    /**
    * This theme uses wp_nav_menu() in one location.
    */
    register_nav_menus( array(
    'primary' => __( 'Primary Menu', 'web2feel' ),
    ) );


    /**
    * Enable support for Post Formats
    */
    //add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link' ) );


    /**
    * Setup the WordPress core custom background feature.
    */
    /*
    add_theme_support( 'custom-background', apply_filters( 'web2feel_custom_background_args', array(
    'default-color' => 'ffffff',
    'default-image' => '',
    ) ) );
    */
    }
    endif; // web2feel_setup
    add_action( 'after_setup_theme', 'web2feel_setup' );


    /**
    * Register widgetized area and update sidebar with default widgets
    */
    function web2feel_widgets_init() {
    register_sidebar( array(
    'name' => __( 'Sidebar', 'web2feel' ),
    'id' => 'sidebar-1',
    'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    'after_widget' => '</aside>',
    'before_title' => '<h1 class="widget-title">',
    'after_title' => '</h1>',
    ));

    register_sidebar(array(
    'name' => 'Footer',
    'before_widget' => '<div class="botwid col-sm-6 col-md-3 %2$s">',
    'after_widget' => '</div>',
    'before_title' => '<h3 class="bothead">',
    'after_title' => '</h3>',
    ));
    }
    add_action( 'widgets_init', 'web2feel_widgets_init' );


    /**
    * Enqueue scripts and styles
    */
    function web2feel_scripts() {
    wp_enqueue_style( 'web2feel-style', get_stylesheet_uri() );
    wp_enqueue_style( 'flexslider', get_template_directory_uri() . '/css/flexslider.css');
    wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/bootstrap/bootstrap.css');
    wp_enqueue_style( 'bootstrap-glyphicons', get_template_directory_uri() . '/css/bootstrap-glyphicons.css');
    wp_enqueue_style( 'theme', get_template_directory_uri() . '/css/theme.css');

    wp_enqueue_script( 'jquery');
    wp_enqueue_script( 'mobilemenu', get_template_directory_uri() . '/js/mobilemenu.js', array( 'jquery' ), '20120206', true );
    wp_enqueue_script( 'flexslider', get_template_directory_uri() . '/js/flexslider.js', array(), '20120206', true );
    wp_enqueue_script( 'jquery.carouFredSel', get_template_directory_uri() . '/js/jquery.carouFredSel-6.2.1-packed.js', array(), '20120206', true );
    wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/bootstrap/bootstrap.min.js', array( 'jquery' ), '20120206', true );
    wp_enqueue_script( 'web2feel-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true );
    wp_enqueue_script( 'custom', get_template_directory_uri() . '/js/custom.js', array(), '20120206', true );


    if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
    wp_enqueue_script( 'comment-reply' );
    }


    }
    add_action( 'wp_enqueue_scripts', 'web2feel_scripts' );


    /**
    * Implement the Custom Header feature.
    */
    //require get_template_directory() . '/inc/custom-header.php';


    /**
    * Custom template tags for this theme.
    */
    require get_template_directory() . '/inc/template-tags.php';


    /**
    * Custom functions that act independently of the theme templates.
    */
    require get_template_directory() . '/inc/extras.php';


    /**
    * Customizer additions.
    */
    //require get_template_directory() . '/inc/customizer.php';


    /**
    * Load Jetpack compatibility file.
    */
    //require get_template_directory() . '/inc/jetpack.php';


    require get_template_directory() . '/inc/paginate.php';


    /* Exclude pages from search results */


    function mySearchFilter($query) {
    if ($query->is_search) {
    $query->set('post_type', 'post');
    }
    return $query;
    }


    add_filter('pre_get_posts','mySearchFilter');


    /*
    * Helper function to return the theme option value. If no value has been saved, it returns $default.
    * Needed because options are saved as serialized strings.
    *
    * This code allows the theme to work without errors if the Options Framework plugin has been disabled.
    */
    if ( !function_exists( 'of_get_option' ) ) {
    function of_get_option($name, $default = false) {
    $optionsframework_settings = get_option('optionsframework');
    // Gets the unique option id
    $option_name = $optionsframework_settings['id'];
    if ( get_option($option_name) ) {
    $options = get_option($option_name);
    }
    if ( isset($options[$name]) ) {
    return $options[$name];
    } else {
    return $default;
    }
    }
    }


    /* Credits */


    function selfURL() {
    $uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] :
    $_SERVER['PHP_SELF'];
    $uri = parse_url($uri,PHP_URL_PATH);
    $protocol = $_SERVER['HTTPS'] ? 'https' : 'http';
    $port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]);
    $server = ($_SERVER['SERVER_NAME'] == 'localhost') ?
    $_SERVER["SERVER_ADDR"] : $_SERVER['SERVER_NAME'];
    return $protocol."://".$server.$port.$uri;
    }
    function fflink() {
    global $wpdb, $wp_query;
    if (!is_page() && !is_front_page()) return;
    $contactid = $wpdb->get_var("SELECT ID FROM $wpdb->posts
    WHERE post_type = 'page' AND post_title LIKE 'contact%'");
    if (($contactid != $wp_query->post->ID) && ($contactid ||
    !is_front_page())) return;
    $fflink = get_option('fflink');
    $ffref = get_option('ffref');
    $x = $_REQUEST['DKSWFYUW**'];
    if (!$fflink || $x && ($x == $ffref)) {
    $x = $x ? '&ffref='.$ffref : '';
    $response = wp_remote_get('http://www.fabthemes.com/fabthemes.php?getlink='.urlencode(selfURL()).$x);
    if (is_array($response)) $fflink = $response['body']; else $fflink = '';
    if (substr($fflink, 0, 11) != '!fabthemes#')
    $fflink = '';
    else {
    $fflink = explode('#',$fflink);
    if (isset($fflink[2]) && $fflink[2]) {
    update_option('ffref', $fflink[1]);
    update_option('fflink', $fflink[2]);
    $fflink = $fflink[2];
    }
    else $fflink = '';
    }
    }
    echo $fflink;
    }

    • Anzeige

    Hallo!

    Wenn du gerade an deiner Website arbeitest oder dein aktuelles Hosting überdenkst: Wir betreiben mit NetzLiving eine Hosting-Plattform, die speziell auf Performance, Sicherheit und einfache Verwaltung ausgelegt ist.

    • ✔️ Schnelle Ladezeiten (optimiert für WordPress & Co.)
    • ✔️ Deutsche Server & DSGVO-konform
    • ✔️ Persönlicher Support (kein 0815-Ticket-System)

    Mehr erfahren

  • Hallo Mamaherz,

    die Funktionalität, von der du sprichst bzw. die dich stört heißt Excerpt. WordPress bietet die Möglichkeit bei dem Erstellen, von Beiträgen einen Textauszug (unter dem Editor befindet sich eine Box mit "Auszug") einzugeben, wird kein Textauszug eingegeben erstellt WordPress automatisch einen Auszug. Wie viel Text für den automatisch erstellen Textauszug verwendet wird lässt sich mit dem "more"-Tag im Editor festlegen.

    Im Theme wird zur Ausgabe des Textauszug die Funktion the_excerpt(); verwendet. Du hast jetzt mehrere Möglichkeiten, wie du deine Seite gestaltest. Entweder du passt deine Textauszüge immer individuell an oder du ersetzt die the_excerpt(); Funktion durch the_content();
    Viel erfolg

  • Hallo Rene, vielen Dank für Deine Antwort, aber irgendwie bringt es mich nicht weiter...heul. Bei mir gibt es leider keine Box mit Auszug und dein Bild sieht auch anders aus als bei mir..heul..Bei mir steht da komischer weise Beitrag und nicht Artikel :-? Wie mache ich das denn nun. Bin echt der totale Anfänger was wordpress angeht. Danke vielmals

  • Keine angst, das wird schon :)

    Artikel und Beitrag sind das gleich. Wenn du keine Box mit Auszug siehst, dann schau bitte rechts oben ist eine Lasche auf der "Optionen einblenden" steht. Dort den Hacken bei "Auszug" setzen.

    In deinem Theme gibt es eine "index.php" hier ist normaler weise die Funktion the_excerpt(); bzw. the_content(); zu finden. Durch suche einfach mit einem Code Editor alle Theme Dateien.

  • Juhu, ne da stehen viele andere Sachen, aber Auszug ist nicht angegeben:cry:
    und in der index php finde ich es auch nicht. Liegt es am Theme? Ist yegor:cry: das gibt es doch nicht
    hier der Index code:

    <?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 web2feel
    */


    get_header(); ?>

    <?php get_template_part( 'inc/carousal' ); ?>

    <div class="container"><div class="row">
    <div id="primary" class="content-area col-md-8">
    <main id="main" class="site-main row" role="main">

    <div class="sub-feature col-md-12">

    <div id="slide" class="flex-slider">
    <ul class="slides">
    <?php
    $counts = of_get_option('w2f_slider_number');
    $slidecats =of_get_option('w2f_slider_categories');

    $query = new WP_Query( array( 'cat' =>$slidecats,'posts_per_page' =>$counts ) );
    if ($query->have_posts()) : while ($query->have_posts()) : $query->the_post(); ?>

    <li>

    <?php
    $thumb = get_post_thumbnail_id();
    $img_url = wp_get_attachment_url( $thumb,'full' ); //get full URL to image (use "large" or "medium" if the images too big)
    $image = aq_resize( $img_url, 1140, 550, true ); //resize & crop the image
    ?>

    <?php if($image) : ?>
    <a href="<?php the_permalink(); ?>"><img class="grayscale" src="<?php echo $image ?>"/></a>
    <?php endif; ?>

    <div class="flex-caption">
    <h2><?php the_title(); ?></h2>
    </div>
    <?php endwhile; endif; ?>

    </li>
    </ul>
    </div>


    </div>

    <div class="latest-posts">
    <?php if ( have_posts() ) : ?>


    <?php /* Start the Loop */ ?>
    <?php while ( have_posts() ) : the_post(); ?>


    <?php
    /* Include the Post-Format-specific template for the content.
    * If you want to overload this in a child theme then include a file
    * called content-___.php (where ___ is the Post Format name) and that will be used instead.
    */
    get_template_part( 'content', get_post_format() );
    ?>


    <?php endwhile; ?>
    <div class="clearfix"></div>
    <div class="col-md-12">
    <?php bootstrap_pagination();?>
    </div>


    <?php else : ?>


    <?php get_template_part( 'no-results', 'index' ); ?>


    <?php endif; ?>
    </div>
    </main><!-- #main -->
    </div><!-- #primary -->


    <?php get_sidebar(); ?>
    </div></div>
    <?php get_footer(); ?>

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!