Create excerpt.php#151
Open
thewheelmaker wants to merge 2 commits into
Open
Conversation
A little bit a monkeying around, there was no {@excerpt/} like there were {@content/} So I figure out to make new copy_paste from the content helper and just change every instance of a the_content()-function on to a the_excerpt()-function and make some fiddling and then name it new file to a excerpt, thus I made that {@excerpt/} works.
ivuorinen
suggested changes
Feb 26, 2021
Contributor
ivuorinen
left a comment
There was a problem hiding this comment.
Thank you for your contribution. Found some things I'd like you to change before we can accept your PR.
Author
|
Thanks, but can you make those fixes yourself that you found them, I think
that would be faster.
pe 26. helmik. 2021 klo 18.04 Ismo Vuorinen (notifications@github.com)
kirjoitti:
… ***@***.**** requested changes on this pull request.
Thank you for your contribution. Found some things I'd like you to change
before we can accept your PR.
------------------------------
In helpers/excerpt.php
<#151 (comment)>:
> @@ -0,0 +1,23 @@
+namespace DustPress;
<?php is missing, please add it to make this file actually work.
⬇️ Suggested change
-namespace DustPress;
+<?php
+namespace DustPress;
------------------------------
In helpers/excerpt.php
<#151 (comment)>:
> + } else {
+ if ( isset( $this->params->id ) ) {
+ $post = get_post( $this->params->id );
+ }
+
+ ob_start();
+ setup_postdata( $post );
+ the_excerpt();
+ wp_reset_postdata();
+ return ob_get_clean();
+ }
No need for the else block here, because return above stops execution.
⬇️ Suggested change
- } else {
- if ( isset( $this->params->id ) ) {
- $post = get_post( $this->params->id );
- }
-
- ob_start();
- setup_postdata( $post );
- the_excerpt();
- wp_reset_postdata();
- return ob_get_clean();
- }
+ }
+
+ if ( isset( $this->params->id ) ) {
+ $post = get_post( $this->params->id );
+ }
+
+ ob_start();
+ setup_postdata( $post );
+ the_excerpt();
+ wp_reset_postdata();
+ return ob_get_clean();
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#151 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGA5YGLMG7WZXJWXBUQUHFDTA7BCXANCNFSM4USGAXLA>
.
--
************************************************************
Ilkka Siirtola
Ohjelmointi, Koodaus, Scripting, programming *best in the bizz**👌👌👌*
Check my blog:
https://praybook2.blogspot.com/search/label/Selfhelp_Code
_Leadership_etc_etc_howlotsofmonney
...and remember *I will be there for you*, if you need
solver of problems, the quiz broker, the decision maker!
I am not there collect alms. But broke hamstrings and result the-
"*WOW! factor*" -Now! for hiring *ALE! ALE! ALE!* *The **professional*
*MASTER OF STYLE ************************************************-puhumme
suomea!
|
thewheelmaker
commented
Mar 30, 2021
Author
thewheelmaker
left a comment
There was a problem hiding this comment.
That <?php how did I not notice that, the missing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A little bit a monkeying around, there was no {@excerpt/} like there were {@content/} So I figure out to make new copy_paste from the content helper and just change every instance of a the_content()-function on to a the_excerpt()-function and make some fiddling and then name it new file to a excerpt, thus I made that {@excerpt/} works.