• Resolved RevelationTravis

    (@revelationtravis)


    Do you have any documentation or other instructions on how to customize the loop?

    I copied archive-wpfc_sermon.php (and single-) into my theme’s root for some minor adjustments to make it fit the general look of my theme, and that works fine, but I really wanted to customize the layout of the posts. Specifically, I want to utilize Bootstrap 4 card groups, which I have successfully done using a custom WordPress loop elsewhere.

    The loop appears to be the called using a custom function “wpfc_sermon_excerpt_v2”, but I’m not sure where I can find that to make adjustments to it. Or is that even possible to do without breaking it?

    My thought is, and perhaps this is a suggestion for future releases, that I could just copy and paste sections of the layout into my custom loop. For example, the picture – copy and paste that to replace “the_post_thumbnail” in the standard WordPress loop. And then similar “snippets” for the other various components. If such snippets exist, then I would think it would be rather easy for me to copy and paste them wherever and output the expected content? Any help you could provide would be appreciated!

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi there!

    To customize the post content on single/archive pages, you’ll need to hook into wpfc_sermon_single_v2 and wpfc_sermon_excerpt_v2 filters, respectively.

    The functions which have the filters are here. You can see how the data is retrieved, etc.

    Regarding your thought/suggestion, it’s not yet possible to do that in Sermon Manager, and we don’t have it on our roadmap to add that capability simply because majority of our users aren’t asking for it, although we understand how, for certain users, this would be beneficial. In our opinion, these filters are just enough for someone who would like to do a bit of layout modifications.

    But, we are working on a similar feature for Sermon Manager Pro. There will also be an UI for easy editing of every aspect of the layout. And, we will add an official code for compatibility with Visual Composer, Elementor, Beaver Builder, Divi, so users will have even more freedom to create a layout they want.

    I hope this answers your questions, and if you have more questions or suggestions – do not hesitate to reply. ??

    • This reply was modified 6 years, 8 months ago by Nikola. Reason: wording
    Thread Starter RevelationTravis

    (@revelationtravis)

    Thank you for your reply! I do appreciate the work that you guys are doing with this plugin. I would be interested in learning more about Sermon Manager Pro. Is there a way to get in on the beta version?

    Thread Starter RevelationTravis

    (@revelationtravis)

    Also, looking at the link you provided, I see why my search for wpfc_sermon_excerpt_v2 failed. It’s because the code says “wpfc_sermon_excerpt_v2(” (note the opening parenthesis). If I had run a search through the code using the opening parenthesis, I would have found the function and probably my answer. So I have another suggestion – add a space in there in case other people are doing control+F like I was. I don’t know how many people are doing that, but it seems like it would be an easy change.

    And thank you for listening to our feedback!

    Plugin Author wpforchurch

    (@wpforchurch)

    Hey @revelationtravis,

    I thought i would chime in about the question regarding the beta for Sermon Manager Pro. Yeah absolutely, we’ll be opening up beta sign ups in the next couple of weeks and we’ll definitely communicate that out via all channels, so keep an eye out for that.

    Thanks,
    Igor

    Thread Starter RevelationTravis

    (@revelationtravis)

    I’m sorry for the third reply, but I just found another suggestion for you guys.

    I copied and pasted the entire “wpfc_sermon_excerpt_v2 ” function into my own functions.php file for modification and ran into a “Cannot redeclare wpfc_sermon_single_v2()” error.

    This should be able to be resolved by wrapping the function in an if statement, like this:

    if ( ! function_exists( ‘wpfc_sermon_single_v2’ ) ) {
    function wpfc_sermon_single_v2( $return = false, $post = null ) {

    Just an idea…

    That’s the reason why those filters are there. ??

    add_filter( 'wpfc_sermon_single_v2', function(){
      $html = '...' // custom layout
    
      return $html;
    } );

    Same applies for wpfc_sermon_excerpt_v2, just replace the filter name.

    Edit: Just add this code to your functions.php file, no need to re-declare functions.

    • This reply was modified 6 years, 8 months ago by Nikola.
    Thread Starter RevelationTravis

    (@revelationtravis)

    Oh okay, I didn’t quite notice those filters! I tried using the example code there and I must be missing something. I can’t get it to work.

    Redeclaring the functions does seem to work, but I’m guessing that’s not the best way to do it?

    Can you give a basic example using the start of some basic HTML? I’m sure it’s something simple that I’m missing.

    Hey,

    I did miss a semicolon on the second line, but it should work otherwise:

    add_filter( 'wpfc_sermon_single_v2', function () {
    	$html = '...'; // custom layout
    
    	return 'hehehe';
    } );
    

    Note: This will only change the output of the single sermon. You’ll need to replace wpfc_sermon_single_v2 with wpfc_sermon_excerpt_v2 for it to work on archive pages and/or shortcode (if you are using development version, otherwise it won’t affect shortcode output at all).

    Now you just need to replace ... with the HTML you want.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Customizing Loop’ is closed to new replies.