-
Notifications
You must be signed in to change notification settings - Fork 23
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
Create excerpt.php #151
base: master
Are you sure you want to change the base?
Create excerpt.php #151
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution. Found some things I'd like you to change before we can accept your PR.
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 ([email protected])
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!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That <?php how did I not notice that, the missing
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.