WordPress.org

Ready to get started?Download WordPress

Forums

Display Posts Shortcode
[resolved] On not faking site structure (8 posts)

  1. Terence
    Member
    Posted 1 year ago #

    Hey Bill,

    You have written two of my all time favorite plugins ~ Display Posts Shortcode and Genesis Subpages as Secondary Menu so, thank you!

    And I figured you'd be the man to know...

    I want to get rid of the separate blog altogether and integrate all posts using the site's structure to place them in the correct cornerstone sections.

    Let me explain what I mean.

    I am new to Genesis so I am having difficulties tracking down how the loop works exactly.

    The loop is generally started with the following code:

    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

    For working with posts, I want to organize this new site's content into "sections" using the Cornerstone plugin [ http://wordpress.org/extend/plugins/cornerstone/ ] and not fake the site structure with categories and tags, so I want to use a couple different functions in place of the default ones:

    <?php if ( cnr_have_children() ) : while ( cnr_have_children() ) : cnr_next_child(); ?>

    In the loop, displaying the post’s content should be exactly the same as with any other template in a theme. So I assume I can use template tags such as the_title(), the_excerpt(), etc.

    Here’s an example loop that displays the title and an excerpt with a link for each post in the section when using Cornerstone...

    <?php if ( cnr_have_children() ) : while ( cnr_have_children() ) : cnr_next_child(); ?>
    <h3><?php the_title(); ?></h3>
    <div><?php the_excerpt(); ?></div>
    <?php endwhile; endif; ?>

    My questions are ~

    A) how is this form of post structuring likely to affect (or not) the loop and other functions within Genesis in general, and more specifically in Dynamik for Genesis?, and

    B) where does the loop start in Genesis?

    C) Can I simply use a Dynamik Custom Hook Box with “genesis_loop” to replace the Genesis loop entirely and not worry about A) & B) ?

    Terence.

    http://wordpress.org/extend/plugins/display-posts-shortcode/

  2. Joe Siegler
    Member
    Posted 1 year ago #

    Did you ever get anywhere with this? I'm running into more or less the same thing.

  3. Terence
    Member
    Posted 1 year ago #

    Nope.

    Never got anywhere with the project.

    Didn't even get an answer from the author.

    So I moved on.

    Onward and upward Geraldo!

  4. Joe Siegler
    Member
    Posted 1 year ago #

    I wonder if this would do anything.

    http://wordpress.org/extend/plugins/page2cat/

  5. Terence
    Member
    Posted 1 year ago #

    Looks interesting.

    I'll give it a try.

    Many thanks.

  6. Bill Erickson
    Member
    Plugin Author

    Posted 1 year ago #

    I don't provide support for these plugins, but I do monitor the forums for bugs to fix. Your original message did not include any bugs and wasn't even about my plugin.

    You should have posted this in the StudioPress support forum or in Cornerstone's support.

    I've never heard of or used Cornerst't accurately describe how it will affect Genesis. But you can see the genesis loop in genesis/lib/functions/loops.php. Here's what it looks like: https://gist.github.com/billerickson/about Dynamik Custom Hook Box, I assume you mean Genesis Simple Hooks. While yes, you could use that plugin, I highly discourage it. If you make any php errors, you'll break your site and not be able to get back in to fix it. It's much easier to simply drop the code you were going to put in there in your functions.php file.

    If you're going to replace the loop, do something like this:

    remove_action( 'genesis_loop', 'genesis_do_loop' );
    add_action( 'genesis_loop', 'be_custom_loop' );
    
    /**
     * My Custom Loop
     *
     */
    function be_custom_loop() {
     // loop goes here
    }
  7. Terence
    Member
    Posted 1 year ago #

    Sorry to disturb you. I asked as you were obviously someone whose expertise on the subject I could recognise.

    However, you were busy and so am I, so now ~ one month late ~ without getting any response, I've had to move on and solve my problem without using Genesis.

    Many thanks.

  8. Joe Siegler
    Member
    Posted 1 year ago #

    Hey Bill, that short code snippet was something I was looking for. Tkx.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.