Skip to content

How To get Page url in learnPress ? #527

Description

@bhaveshdarji386

Hello,
I am trying to get current page url. but I am not able to get I tried many ways to get id or url but not succeed
global $post;
echo $post->ID;

global $wp_query;
echo $wp_query->post->ID;

global $wp;
echo home_url( $wp->request )

not able to get id

global $wp;
echo home_url( $wp->request );

global $wp;
echo add_query_arg( $wp->query_vars, home_url() );

global $wp;
echo add_query_arg( $wp->query_vars, home_url( $wp->request ) );

www.host.com/wp-json/lp/v1/lazy-load/course-curriculum

I am getting this url but not getting browser one it should be something like

http:/host.com/courses/cambridge-igcse-physics-paper-2-mcqs-extended/quizzes/4-physics-2021-may-june-23

Please help me to find this solution I am new in wordpress.
Your response will be highly appreciate.
Thank You in advance ^_^

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions