Editing the WAVE theme to not use FB Card description field for podcast?

The Wave theme is great and perfect for what I am trying to do. HOWEVER, it includes a hacky work-around that is making my life difficult.

The code for the theme somehow hijacks the DESCRIPTION field of the Facebook card and uses it as a trigger to embed a podcast audio player in your post. Doesn’t matter if there’s a podcast in your post or if you add audio or not - just by filling out the description field for the FB card, you get a player at the top of your post whether you want it or not.

I’ve poked around the code a little and I don’t see how they are accomplishing this nor how to shut it off. Does anyone out there have experience editing this theme?

Thanks!

JD, did you look at post.hbs when I linked it the other day? That’s where it is. Look for #if @facebook_description…,

1 Like

I THOUGHT I looked through the post.hbs but I’m guess I’m missed it.

I was able to remove all the RSS/Spotify/Apple icons from the bottom (though it makes json mad because those variables are now defined but not used)

I’ll look again now ty

Here’s my entire post.hbs - I added FB comments at the bottom but otherwise I don’t see a FB reference anywhere (possible I am just dense)

{{!< default}}

{{#post}}

<main class="site-main">
    <article class="{{post_class}} single">

        {{#if og_description}}
            <div class="gh-outer">
                {{> "player"}}
            </div>
        {{else}}
            <header class="post-header gh-canvas">
                {{> "post-meta"}}
                <h1 class="post-title">{{title}}</h1>
                {{> "feature-image"}}
            </header>
        {{/if}}

        <div class="post-content gh-content gh-canvas">
            {{content}}
        </div>

        <div class="gh-canvas">
            {{#if comments}}
            <section class="gh-comments">
                <div class="fb-comments" data-href="{{url absolute="true"}}" data-numposts="10"></div>

             </section>
            {{/if}}
        </div>

    </article>
</main>

{{/post}}

it’s og_description. Sorry, forgot it was called that. See how if it’s set, it includes the ‘player’ partial? (You’ll find that partial in partials/player.hbs.)

In player.hbs I see this:

<audio class="player-audio" src="{{og_description}}"></audio>

would simply deleting that fix it perhaps?

That would completely remove the player. Was that what you wanted, or did you just want to change when it triggers?

Probably best to just change when it triggers, right? In case I find a use for it later? To do that would I just remove the contents of the src?

<audio class="player-audio" src=""></audio>

and then go back and edit it later if I needed it?

So take a look at this again. If you just remove the player contents, you’re going to get nothing for posts that have an og_description. Instead, you want to change that if statement to change if the player gets drawn.

1 Like

So to be clear, I’d remove the reference to the player and then not need the else? Like this:

        {{#if og_description}}
            <header class="post-header gh-canvas">
                {{> "post-meta"}}
                <h1 class="post-title">{{title}}</h1>
                {{> "feature-image"}}
            </header>
        {{/if}}

Your code above says that “If the facebook description is set, put in the post-meta, title, and featured image.” Otherwise, don’t do anything in this part of the code. Is that the desired behavior?

I’m not sure. What’s the default behavior before the designers of WAVE decided to muck with the fb descriptions?

Do you want the title of the post displayed, or not?

Yes I think I do. Thanks !

The code you pasted will show title if the Facebook description is set.

Hi Cathy, two followups here.

#1 - what if i want the title regardless of whether or not the FB description is set?
#2 - for some reason the icon that accompanies any post where the FB description is set still has the PLAY icon on it.

image

Any way to solve those two things?

1- you should remove those ifs if you want that title code to always happen.

Sorry to ask to be spoonfed but I am 95% sure I’ll butcher the code. The current code block looks like this:

        {{#if og_description}}
            <header class="post-header gh-canvas">
                {{> "post-meta"}}
                <h1 class="post-title">{{title}}</h1>
                {{> "feature-image"}}
            </header>
        {{/if}}

Your suggestion is to just remove the IF part like this?

         <header class="post-header gh-canvas">
                {{> "post-meta"}}
                <h1 class="post-title">{{title}}</h1>
                {{> "feature-image"}}
            </header>

If you always want that content to show, then yes, that’s my recommendation.

The code inside the {{#if}} {{/if}} only runs when the if is truth-y. So it happens if og_description (the Facebook description) has a value set, but doesn’t run if it is not set. Hope that makes sense!!

1 Like