Doesn't play nicely with shortlink generator
-
I just discovered that my shortlink generator was not working. I could select the shortcode but it would not insert it into the post.
Having removed all the plugins one by one, I found it was Cornerstone that is the culprit. I am using the Flare theme you can see here https://flare.bringthepixel.com/ ~ any ideas?
-
I must have got this wrong. How should I insert Cornerstone in this page.php?
<?php /** * The full width (default) template for displaying a single page. * * @package BTP_Flare_Theme */ ?> <?php get_header(); ?> <?php the_post(); ?> <?php get_template_part( 'precontent' ); ?> <div id="content" class="<?php echo btp_content_get_class(); ?>"> <div id="content-inner"> <?php if ( btp_elements_get( 'breadcrumbs' ) ): ?> <?php btp_breadcrumbs_render( btp_breadcrumbs_get() ); ?> <?php endif; ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <div class="entry-content"> <?php the_content(); ?> <?php btp_wp_link_pages(); ?> </div><!-- .entry-content --> <div class="entry-utility"> <?php edit_post_link( __( 'Edit', 'btp_theme' ), '<span class="edit-link">', '</span>' ); ?> </div><!-- .entry-utility --> <?php comments_template( '', true ); ?> </article> </div><!-- #content-inner --> <div class="background"><div></div></div> </div><!-- #content --> <?php get_footer(); ?>
Re: Shortcodes
Do you have the latest version of Cornerstone? A recent update removed some legacy code and Cornerstone should not have any interaction with shortcodes in the post editor.
Re: Adding Cornerstone to Theme template
It doesn’t appear that CNR is added to the template you posted. Is CNR not working when you add it? There should be no problem with adding CNR anywhere in a theme’s template, so where you add it depends on where on the page you want the section’s content to be displayed.
Yes, I have the latest version and I think the “not playing nicely” problem was coming from the fact that CNR was activated but not added to the page code.
Not being a programmer I see something quite different to you when I look at that page and I couldn’t see where to add it.
When I asked the theme author he told me it would take days of development time and he wouldn’t even take it on if I offered to pay him.
Which is a big disappointment really, because I thought CNR was going to be relatively easy to implement.
Adding CNR to a theme template only requires a few lines of code as demonstrated in the following tutorial:
How to Organize Posts in Sections in WordPress with CornerstoneYou can use the example loop in the tutorial as a starting point. As in that example, adding CNR to a template can be as simple as adding 4 lines of code.
You can also use the example CNR-enabled
page.php
template I provided in the other thread as a reference.Though it is simple to implement CNR, it does require experience with editing WordPress theme files and HTML.
WordPress’ official documentation on Theme Development is a great resource if you’re seeking a DIY approach, otherwise, I’d recommend hiring someone with WordPress theme experience and pointing them to the above tutorial.
Thank you so much for all the help you are trying to provide me but I am still a little confused.
It turns out that ~ according to the theme’s author ~ the loop for the blog page (list of posts) is not in the code sample I gave you above, but located in “flare/lib/posts/templates/collection-list_one_twelfth.php” and “flare/lib/posts/templates/collection-one_fourth.php” and “flare/lib/posts/templates/collection-two_thirds.php” (depends on which layout I use ~ probably 2/3 content + 1/3 sidebar ~ so it’ll be this file “flare/lib/posts/templates/collection-two_thirds.php”).
I have posted all 3 here…
https://pastebin.com/A2sXx2Zs [list_one_twelfth.php]
https://pastebin.com/wLuvnYAN [one_fourth.php]and the one I will be using…
https://pastebin.com/ndV6FpZ4 [collection-two_thirds.php]
My point is, not being a PHP programmer, its still not clear to me where should make the entry point for the sample code as a starting point.
When you look at the page you see statements and queries, when I look at the page I see words which make no sense to me, and squiggles. Can you help me just a little more?
Pretty please?
Do I simply replace…
<?php while ( $query->have_posts()): $query->the_post(); ?><li> <article class="pid-<?php the_ID(); ?> format-<?php echo get_post_format(); ?>">
with…
<?php if ( cnr_have_children() ) : while ( cnr_have_children() ) : cnr_next_child(); ?>
Terence.
You would probably want to make a copy of the desired loop template file and modify it as you indicated to load CNR content. The
page.php
template you included a few posts back does not link to any loop template, so you would also want to include the newly-modified loop template inpage.php
.If you are having difficulty working with WordPress’ theme structure, I would highly recommend either diving into WordPress’ official documentation on Theme Development or hiring an experienced developer to do the work you require.
The problem is we are a small nonprofit and don’t have a budget to hire people to do this kind of thing for us. We have to rely on the kindness and generosity of others.
So if you can’t help us, and the author of the theme won’t help us, we’re stuck, as we don’t have the competency to integrate your plugin with this theme.
I must confess I thought it was going to be a lot more simple to do than its proving to be ~ due to the many different ways various authors create the loop in their themes.
I see your difficulty in creating a universal interface but on the other hand, I also see ours, and the people we are trying to reach. I really thought Cornerstone was going to be able to help us.
Terence.
Though CNR may not fit your needs, I do hope that you find a solution that does.
Aloha.
That’s the problem Sol. It does fit our needs. Its just too damn complicated for me to integrate without some help from you, which you seem unwilling to give.
Which _is_ a shame.
Peace.
Maybe, there is another way to address this issue.
Which WordPress themes do you know of ~ specifically ~ that I can buy and that integrate easily with Cornerstone?
Terence.
- The topic ‘Doesn't play nicely with shortlink generator’ is closed to new replies.