Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi Paoletto82,m

    I think what you want is to register a sidebar widget for your footer on functions.php like (search for register_sidebar and add just below the one(s) that will be ther by default)

    register_sidebar( array (
    	    'name' => 'Footer Area',
    	    'id' => 'footer_widget_area',
    	    'before_widget' => '<div id="%1$s" class="widget-container %2$s">',
    	    'after_widget' => "</div>",
    	    'before_title' => '<h3 class="widget-title">',
    	    'after_title' => '</h3>',
    	  ) );

    Go to the Widgets and drag and drop this and any other plugin you want to put on the footer than on footer.php call like this:

    <?php if ( is_sidebar_active('footer_widget_area') ) : ?>
    	<?php dynamic_sidebar('footer_widget_area'); ?>
    <?php endif; ?>

    Hope it helps!!

    How do i set the number of posts per page on the news stories, its default to 10, i want to change it. I’m trying post_limit but it just doesnt work.

    Help anyone?

    I did a quick shortcode to display on my homepage:

    in the custom-post-type.php constructor i added:

    add_shortcode($this->slug, array($this, 'plugin_shortcode') );

    Than i created 2 other functions

    function plugin_shortcode($atts) {

    $file = get_stylesheet_directory(). “/home/”.$this->slug.”.php”;

    if ( !file_exists( $file ) )
    return false;

    $args = array(
    ‘post_type’ => $this->slug,
    ‘post_status’ => ‘publish’,
    ‘posts_per_page’ => is_numeric($atts[‘count’]) ? $atts[‘count’] : 5,
    ‘order’ => ‘DESC’
    );
    $posts = query_posts($args);
    wp_reset_query();

    $items = Array();
    $pne = ‘press-news-events’;

    foreach($posts as $k => $item) {

    $link = get_permalink($item->ID);

    $date = get_post_meta($item->ID, ‘_date’, true);

    $item->day = date_i18n(__(‘d’, $pne), $date);
    $item->month = date_i18n(__(‘M’, $pne), $date);
    $item->year = date_i18n(__(‘Y’, $pne), $date);
    $item->title = $item->post_title;
    $item->link = (strpos($link, ‘http://&#8217;) !== false) ? $link : “http://{$link}”;

    $items[$k] = $item;
    }

    return $this->render_template($file, $items);
    }

    function render_template($template, $data){

    if ( !file_exists( $template ))
    return;

    ob_start();
    include($template);
    $html = ob_get_clean();
    return $html;
    }

    than all i had to do was call like:

    [news count=10]

    or [events count=10]

    and it would get the template from a folder called “home” in my themes and display the html. 🙂

    hope it helps.

    Hi Matt,

    Well, I’m trying to create different pages for each archive. I’ve manage to create archive-news.php and that works fine for news, but i’m not managing to create a custom archive page for events/past events.

    Would you be able to give me some orientation? I don’t really want to know the archive.php instead I would like to create a custom page.

    hope you can help.
    thanks

    Thread Starter rafaelfaria

    (@rafaelfaria)

    If someone had the same problem and managed to get it working, please, let me know.

    Thanks
    Raf

Viewing 5 replies - 1 through 5 (of 5 total)