Forum Replies Created

Viewing 15 replies - 31 through 45 (of 46 total)
  • Thread Starter leanda

    (@leanda)

    Thanks for replying, it’s driving me insane. Feel like I’m missing something really simple.

    The output for var_dump( $child_page ) is:

    object(WP_Post)#341 (24) {
    ["ID"]=> int(196)
    ["post_author"]=> string(1) "1"
    ["post_date"]=> string(19) "2014-05-24 14:51:20"
    ["post_date_gmt"]=> string(19) "2014-05-24 14:51:20"
    ["post_content"]=> string(0) ""
    ["post_title"]=> string(17) "Fordlandia: domus"
    ["post_excerpt"]=> string(0) ""
    ["post_status"]=> string(7) "publish"
    ["comment_status"]=> string(6) "closed"
    ["ping_status"]=> string(6) "closed"
    ["post_password"]=> string(0) ""
    ["post_name"]=> string(16) "fordlandia-domus"
    ["to_ping"]=> string(0) ""
    ["pinged"]=> string(0) ""
    ["post_modified"]=> string(19) "2014-06-25 11:20:22"
    ["post_modified_gmt"]=> string(19) "2014-06-25 11:20:22"
    ["post_content_filtered"]=> string(0) ""
    ["post_parent"]=> int(194)
    ["guid"]=> string(67) "http://www.iofpi.co.uk/civicworks.net/?post_type=archive&p=196"
    ["menu_order"]=> int(1)
    ["post_type"]=> string(7) "archive"
    ["post_mime_type"]=> string(0) ""
    ["comment_count"]=> string(1) "0"
    ["filter"]=> string(3) "raw"
    }

    And the output for var_dump( $terms ) is:

    array(1) {
    [5]=> object(stdClass)#82 (11) {
    ["term_id"]=> int(5)
    ["name"]=> string(11) "Publication"
    ["slug"]=> string(11) "publication"
    ["term_group"]=> int(0)
    ["term_taxonomy_id"]=> int(10)
    ["taxonomy"]=> string(5) "media"
    ["description"]=> string(0) ""
    ["parent"]=> int(0)
    ["count"]=> int(1)
    ["object_id"]=> int(196)
    ["filter"]=> string(3) "raw"
    }

    The full code I’m using to get the parent and sub pages is:

    <?php
    
        $parent_pages = get_pages( array( 'parent' => 0, 'post_type'=> 'archive', 'orderby' => 'menu_order' , 'order' => 'ASC', 'sort_column' => 'menu_order' ) );
        foreach ( $parent_pages as $parent_page ) {
    
        echo '<h1 class="page-heading" id="';
        echo $parent_page->post_name;
        echo '">';
    
        echo $parent_page->post_title;
        echo '</h1>';
         echo '<div class="wrapper grid4">';
    
        $all_pages = get_pages(array( 'post_type'=> 'archive',  'orderby' => 'menu_order' , 'order' => 'ASC', 'sort_column' => 'menu_order' ) );
        $child_pages = get_page_children($parent_page->ID, $all_pages );
        foreach ( $child_pages as $child_page ) {
           $terms = get_the_terms( $child_page->ID, 'media' );
          echo '<article class="post col ' . $terms->slug .'">';
    
         echo '<a class="fancybox" data-fancybox-type="iframe" href="http://www.iofpi.co.uk/civicworks.net/wp-content/plugins/pdfjs-viewer-shortcode/web/viewer.php?file=http://www.iofpi.co.uk/civicworks.net/wp-content/uploads/2014/05/Citizen_Manchester.pdf" title="' . the_title_attribute('echo=0') . '" >';
    
          echo get_the_post_thumbnail( $child_page->ID, 'medium');
    
          echo '</a>';
    
            echo '<h1>';
          echo $child_page->post_title;
          echo '</h1>';
    
          echo '</article>';
        }
             echo '</div>';
          }
          ?>

    leanda

    (@leanda)

    Hi

    Thanks for the information above.

    I’ve got pdf.js working within fancybox using the info above and linking to the iframe, but how can I use the shortcode options? For example how can I set the fullscreen=true?

    Any help very much appreciated?

    Thanks

    Thread Starter leanda

    (@leanda)

    Thanks, I’ll give this a whirl.

    Thanks again for your help.

    Thread Starter leanda

    (@leanda)

    Thanks! Don’t think an array of IDs will work in this case because new pages and sub pages will be added and it needs to be dynamic.

    Any chance you could please elaborate on where to add the loop?

    Cheers

    Thread Starter leanda

    (@leanda)

    Update: Managed to get a little bit further, almost there I think. I can now see just one sub post (the latest) and the same sub post is duplicated under each parent title either though it isn’t a child of the others.

    Can anyone please help me nail this last bit. Thanks.

    <?php $parent_pages = get_pages( array(
                'parent' => 0,
                'post_type'=> 'archive'
                ));
    
            foreach( $parent_pages as $parent_pages)
                { ?>
    
            <h1><?php echo $parent_pages->post_title; ?></h1>
    
            <?php
            $children = get_pages(array(
                'orderby' => 'menu_order',
                'order' => 'ASC',
                'post_parent' => $post->ID,
                'post_type' => get_post_type( $post->ID )
                ));
    
            foreach($children as $child);
            ?>
            <h2><?php the_title(); ?></h2>
            <?php the_content(); ?>
    
            <?php } ?>
    Thread Starter leanda

    (@leanda)

    Updated the plugin, removed the memory limit and it’s all working fine! Thanks Matthew!

    Thread Starter leanda

    (@leanda)

    Thanks Matthew. Happy to test for you!

    Thread Starter leanda

    (@leanda)

    That would be great if you could do that!

    Thread Starter leanda

    (@leanda)

    Okay for anyone else having this problem, I solved it by upping the memory limit in wp-congfig.php to define(‘WP_MAX_MEMORY_LIMIT’, ‘2048M’);

    Thread Starter leanda

    (@leanda)

    Looks like the reason the entries page isn’t showing is because there are 27000 entries!

    I can get the data out by exporting as a CSV from the database manually, but it’s unusable as the form field data is all in one column. Any advice on separating the form fields from the single data column?

    Thanks

    Thread Starter leanda

    (@leanda)

    Nobody know if this is possible and who to go about doing it?

    Thanks

    Thread Starter leanda

    (@leanda)

    Thanks a lot, I’ll install this and see what it’s capable off 😉

    Thread Starter leanda

    (@leanda)

    Ok, I cracked it. Didn’t realise I had to make another empty static page, just called it News and it worked.

    Thread Starter leanda

    (@leanda)

    Thanks very much.

    I’ll try both these methods out today.

    Thanks

    Thread Starter leanda

    (@leanda)

    Thanks! I’ve had a quick look and it looks like it will do what I need.

    Thanks so much for your help, I really appreciate it.

Viewing 15 replies - 31 through 45 (of 46 total)