WordPress.org

Ready to get started?Download WordPress

Forums

Wp-query widget and backend problems (1 post)

  1. s_amuel
    Member
    Posted 5 years ago #

    I´ve created a nasty monster that works fine at the front end but gives me white pages in the backend admin-panel everytime a save or post anything from widget settings to update a post.

    A simple plugin that gives an excerpt from my last post in the sidebar... but huge problems backend. I´ll post the code here... what do you think? Free to use if you fix the code ;)

    <?php
    /*
    Plugin Name: Customexcerpt
    Plugin URI: http://www.1979design.se
    Description: Loop latest post and define excerpt length
    Author: Samuel Larsson & Hanna Hollstrom
    Version: 2
    Author URI: http://www.1979design.se & http://www.hannahollstrom.se
    */
    function queryexcerpt_widget() {
    $recent = new WP_Query("cat=6&showposts=1");
    while($recent->have_posts()) : $recent->the_post();
    the_content_rss('$more_link_text', '','', 15, '');
    ?>

    " rel="bookmark"> Read more

    <?php endwhile;
    }

    function init_queryexcerpt(){
    register_sidebar_widget("Customexcerpt", "queryexcerpt_widget");
    }

    add_action("plugins_loaded", "init_queryexcerpt");

    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.