Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter jumpyadventure

    (@jumpyadventure)

    Thanks for the answer.

    I finaly found how to solve my issue.
    If this can help someone:

    I have created a custom template page and wrote my php code inside.

    Thread Starter jumpyadventure

    (@jumpyadventure)

    Hello @alchymyth
    Thanks for your answer.
    I have check your link and implemented as written.

    But it seems that when I integrate PHP code in my page following this step:

    1. Clicking on the 3 dotand clicking the link : Editor -> Code Editor
    2. Paste this code

    <?php
        // Get the ID of a given category
        $category_id = get_cat_ID( 10);  --> 10 is my category ID
     
        // Get the URL of this category
        $category_link = get_category_link( $category_id );
    ?>
     
    <!-- Print a link to this category -->
    <a href="<?php echo esc_url( $category_link ); ?>" title="Category Name">Category Name</a>

    When I do that I got an error message :

    This block contains unexpected or invalid content.
    How can I use PHP in my page.
    I am using Xamp.
    thanks

Viewing 2 replies - 1 through 2 (of 2 total)