winnydejong

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • in reply to: Adjust pagination Eleven40 theme #130486

    winnydejong
    Participant
    Post count: 28

    Hi Brad,

    My Genesis > Theme settings are set to show 10 posts a page. The reading settings are also set to show 10 posts a page.

    The code I’ve added to the funtions.php only influences the front page, which now shows only the 5 latest post.

    The problem still remains: when you’re on the homepage of datajournalistiek.nl, according to the pagination there are 29 pages. In reality there only 15 pages: on the frontpage the paginations divides the total number of posts by the number of posts you can actually see on the frontpage (5). In reality these 5 posts on the homepage are an exception, since all other pages show 10 posts.

    How do I set up the pagination accordingly?

    Thanks in advance.

    Best, Winny

    in reply to: add image to header in Eleven40 Pro #113545

    winnydejong
    Participant
    Post count: 28

    Hi Sridhar (and Heidi),

    I wanted to do the same at my blog http://datajournalistiek.nl, but cant seem to get the image right. If I make the changes you describe in your blogpost my blog just dissapears of the radar all together…

    Any idea of what could be going on? Or could it have to do something with the Genesis 2.1.1 update?

    Thanks in advance, best, Winny

    in reply to: Style Eleven40 sidebar CSS #85694

    winnydejong
    Participant
    Post count: 28

    The right URL should be: http://v2.datajournalistiek.nl


    winnydejong
    Participant
    Post count: 28

    Hi Anitac,

    The URL to my website is http://datajournalistiek.nl – hopefully you still like to figure it out.

    Thanks in advance!


    winnydejong
    Participant
    Post count: 28

    Made another topic for the pagination thing – http://www.studiopress.com/forums/topic/pagination-how-to-fix-and-add-to-eleven40-pro/, including the link to my site. Any idea how to fix the pagination on the frontpage?

    And any idea how to include the same style pagination on another page?

    Thanks, Winny

    in reply to: Custom Feed Page Eleven40 #59336

    winnydejong
    Participant
    Post count: 28

    With a little help I categorised all rss items by date; made a bullet list of the feed; added basic pagination; and fixed the title (shows up correctly).

    My solution:

    [php]<?php

    /*
    Template Name: links
    */

    // Filter toevoegen aan the_content()
    add_filter(‘the_content’, ‘winny_rss_content’);

    function winny_rss_content ($content) {
    //Add my latest links to page
    include_once(ABSPATH.WPINC.’/rss.php’); // path to include script

    $feed = fetch_rss(‘http://feeds.pinboard.in/rss/u:winnydejong/t:ddj/?count=400′); // specify feed url
    $items = array_slice($feed->items, 0, 999); // specify first and last item

    if (!empty($items)) {
    // Per pagina
    $perpage = 20;
    $page = (int) $_REQUEST[‘pagina’];
    $pages = ceil(count($items) / $perpage);

    if ($page < 0 || $page >= $pages) {
    // Automatisch eerste pagina als pagina nummer niet bestaat
    $page = 0;
    }

    // Selectie maken
    $items = array_slice($items, $perpage * $page, $perpage);

    // $date definieren, maar geen inhoud
    $date = ”;

    foreach ($items as $item) {
    // Datum filteren
    $item[‘date’] = date(‘j-n-Y’, strtotime($item[‘dc’][‘date’]));

    if ($date != $item[‘date’]) {
    if ($date) {
    // Vorige lijst afsluiten
    $content .= ‘‘;
    }

    // Nieuwe datum
    $date = $item[‘date’];

    // Nieuwe lijst begonnen
    $content .= ‘<h5>’ . $item[‘date’] . ‘</h5>';
    $content .= ‘

    ‘;

    if ($pages > 1) {
    // Meer dan 1 pagina
    $content .= ‘<p>Pagina: ‘;

    for ($i = 0; $i < $pages; $i ++) {
    if ($i == $page) {
    $content .= ‘‘ . ($i + 1) . ‘, ‘;
    } else {
    $content .= ‘‘ . ($i + 1) . ‘, ‘;
    }
    }

    // Einde pagina’s
    $content = substr($content, 0, -2) . ‘</p>';
    }
    }

    return $content;
    }

    genesis();[/php]

    • This reply was modified 1 year, 3 months ago by  winnydejong.
    • This reply was modified 1 year, 3 months ago by  winnydejong.
    in reply to: Custom Feed Page Eleven40 #59255

    winnydejong
    Participant
    Post count: 28

    Worked some of it out by my own. Though the title of the page and the entry paragraph are still showing up under the footer… Any ideas? Help is very much welcomed! :)

    [php]<?php
    /*
    Template Name: Pinboard
    */
    get_header(); ?>
    <div id="content" class="content">
    <?php
    // FORCE FULL WIDTH LAYOUT
    //add_filter ( ‘genesis_pre_get_option_site_layout’, ‘__genesis_return_content_sidebar’ );
    //remove_action( ‘genesis_loop’, ‘genesis_do_loop’ );

    //Add my latest links to page
    include_once(ABSPATH.WPINC.’/rss.php’); // path to include script
    $feed = fetch_rss(‘http://feeds.pinboard.in/rss/u:winnydejong/t:ddj/’); // specify feed url
    $items = array_slice($feed->items, 0, 20); // specify first and last item
    ?>

    <?php if (!empty($items)) : ?>
    <?php foreach ($items as $item) : ?>

    <h3>"><?php echo $item[‘title’]; ?></h3>
    <p><?php echo $item[‘description’]; ?></p>

    <?php endforeach; ?>
    <?php endif; ?>
    </div><!– #content –>

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

    <?php genesis(); ?>[/php]


    winnydejong
    Participant
    Post count: 28

    Hi!

    Do you know how to change my pagination accordingly. At the homepage (with only 5 posts) you’ll see page 1, 2, … and 27 – while there is no page 27 since all other pages show 10 posts. When you’re on the second page – which displays 10 posts – you’ll see page 1, 2, … and 14. Which is correct. This problem definitly has to do with changing the number of posts on the frontpage…

    Any idea how to show the correct last pagenumber at the frontpage? Thanks in advance!!


    winnydejong
    Participant
    Post count: 28

    Thanks Brad for cleaning up the code :) Works just great!


    winnydejong
    Participant
    Post count: 28

    Actually when I start using the code Holli sent me, it also limited the number of posts on pages 2, 3, etc. instead of only on the frontpage. After some research I came up with this, and now only the frontpage shows 5, all other pages show 10 posts:

    [php]//* Limit the frontpage to only showing latest 5 posts – all other pages show 10
    function frontpage_custom_post_count(&$query)
    {
    // show specific number of posts on frontpage
    $frontpagePostsCount = 5;
    if (is_front_page() and !is_paged()) {
    $query->query_vars[‘posts_per_page’] = $frontpagePostsCount;
    }
    // show configured posts on the rest of pages, offsetting the ones showed on frontpage
    if (is_front_page() and is_paged()) {
    $posts_per_page = isset($query->query_vars[‘posts_per_page’]) ? $query->query_vars[‘posts_per_page’] : get_option(‘posts_per_page’);
    $query->query_vars[‘offset’] = (($query->query_vars[‘paged’] – 2) * $posts_per_page) + $frontpagePostsCount;
    }
    }
    add_action(‘pre_get_posts’, ‘frontpage_custom_post_count’);[/php]

    • This reply was modified 1 year, 3 months ago by  winnydejong. Reason: code didn't looked right
    • This reply was modified 1 year, 3 months ago by  winnydejong. Reason: code didn't looked right

    winnydejong
    Participant
    Post count: 28

    Hi Anitac,

    I changed it exactly as you stated, but it still doesn’t work… Any suggestions left?

    Thanks!


    winnydejong
    Participant
    Post count: 28

    Hi idavinder,

    I did exactly as you said above, but unfortunately no changes to be seen in my menu.

    Right now I’m using the latest version of the Eleven40 theme, as seen here: http://demo.studiopress.com/eleven40/

    Any ideas what I did wrong?

    Thanks in advance. Best Winny


    winnydejong
    Participant
    Post count: 28

    It works great – thanks Holli! Is there any way to limit this to the frontpage?


    winnydejong
    Participant
    Post count: 28

    Thanks for your suggestion Holli – unfortunately though, it doesn’t seem to work… Any ideas?

    in reply to: Change Post Numbers in Eleven40 #55851

    winnydejong
    Participant
    Post count: 28

    Sorry, I might have been unclear. I’d like the homepage to show only five posts (1 featured, 4 grid) but I want all the other pages – archive, categories etc. – to show 10.

    If I make the changes you describe those pages will only show 5 posts… Any ideas how to fix this?

Viewing 15 posts - 1 through 15 (of 16 total)