• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Genesis Sample Theme page.php

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Genesis Sample Theme page.php

This topic is: not resolved

Tagged: edit page.php, page.php

  • This topic has 2 replies, 2 voices, and was last updated 8 years, 2 months ago by socotroco.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • February 13, 2017 at 7:44 pm #201100
    socotroco
    Member

    Hello.
    I am instructed to add a few lines of code to the page.php file of my wordpress theme, the problem is that there is no such file in the theme folder.
    The code below is the one i am trying to implement.

     if ( ($pagerating = get_post_meta( $post->ID, 'rating', true ) )) {
        $rating  = explode( "/", $pagerating );
        $score   = $rating[0];
        $reviews = $rating[1];
        $product = get_the_title();
        $ratingoutput = '<script type="application/ld+json">{"@context": "http://schema.org","@type": "Service","name": "' . $product . '","aggregateRating": {"@type": "AggregateRating","ratingValue": "' . $score . '","reviewCount": "'. $reviews . '"}}</script>';
        echo $ratingoutput . "n";
      }
    

    It will let me add reviews manually to specific pages using custom fields.
    I see that the genesis framework main files have a page.php file but it states very clearly:

    * WARNING: This file is part of the core Genesis Framework. DO NOT edit this file under any circumstances.

    How can i achieve this?
    Thanks much in advance.

    *Cannot provide a URL because I am working on it on my localhost.

    February 14, 2017 at 4:57 am #201115
    Brad Dalton
    Participant

    You can modify the code in this tutorial by adding your code to the code snippet.


    Tutorials for StudioPress Themes.

    February 21, 2017 at 1:56 am #201691
    socotroco
    Member

    Thanks so much for the help.
    Accomplished what I needed by following your tutorial.

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble