WordPress.org

Support

Support » Plugins and Hacks » Wp-query widget and backend problems

Wp-query widget and backend problems

  • 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”);

    ?>

  • The topic ‘Wp-query widget and backend problems’ is closed to new replies.
Skip to toolbar