Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Seen before: field which auto-increments when the post has been viewed #10

Closed
bobbingwide opened this issue Mar 25, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@bobbingwide
Copy link
Owner

bobbingwide commented Mar 25, 2021

In the Genesis-SB theme the "Seen before" field displays the value of the post meta field called _seen_before.
This field is auto-incremented each time the post is viewed individually.

image

I need to replicate this logic in SB.
I imagine this will have to be implemented as a new block.
It'll give me the opportunity to learn how to access post meta data.

Note: In my first attempt to simply display the current value of the field nothing is being shown for the [bw_field _seen_before] shortcode.

@bobbingwide
Copy link
Owner Author

bobbingwide commented Mar 27, 2021

Two things.

  1. I managed to get the shortcode to work. The field was defined as '#theme' => false.
  2. The code in Genesis-SB has been wrong for a while. It generates invalid HTML. The span's are wrong.
<div class="seen-before">Seen before: </span><span class="seen-before-value">1,468 times</div>

I'm working on the new code. So it'll be fixed there.

@bobbingwide
Copy link
Owner Author

Closing this as the block is now part of bigram upon which the theme is dependent. See issue #23 above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant