Noobie Question | How do I edit content?

Hi there. I inherited a site built with sage (and possibly other dependencies like roots, still trying to figure that out) and I cannot for the life of me figure out where this developer makes edits to the content of the pages. I combed through all the files of the site and I just cannot find anything relevant to the content in the pages.

This may be a redundant question, but is there a tutorial/walkthrough on the basic functionality of sage and how things are setup. I definitely have a lot to learn about sage, it’s very complicated.

Sorry to state the obvious… but the content is normally managed in WordPress… can you check which page template is being used and check that the WordPress ‘the_content()’ is being called?

Sage is not that different to any other theme when it comes down to simple content input in WordPress.

So I’ve looked in the wp pages and I see “header image” but the content that goes for that particular header is no where. The way this installation appears is almost like a page builder, but from what I can tell it’s all been loaded through PHP in the backend.

I have access to the all the files on the site. This specific template does have that callback but I don’t think it’s pulling the content (mainly the text and the button).


https://www.e3housing.com if that helps

You should be able to look at the header section in the theme to determine where that content is being pulled from, and then use that to track down where it’s stored. This site looks like it’s using Advanced Custom Fields, so you might want to look for the function get_field() or the_field() in the template files. It also looks like this page is using a page template called “Full Width Header” so you might try looking for the corresponding template file to see if you can determine where it’s pulling that content from.

It’s using a plugin called Advanced Custom Fields.

If you hover over where it says Page Header Image a cog icon should appear, click on that and you will see the field names. You can then search for the field within your theme php files, it will likely be something like get_field(‘page_header_image’).

If you find it, make sure it’s being called within the Page Template called ‘Full Width Header’ which this page is currently using.

Hope that helps?

Hey thank you so much for the tips. I just checked the advanced custom fields and this is what I can see:

Then I checked the page template and this is what I see:

And as far as I can tell it appears like it’s pulling from the structure “roots/sage/…” which I cannot for the life of me find that file structure anywhere in the files.

Roots_Sage

Just learned about the reply all feature, so making a duplicate of the other helper…will reply all after this

So far this is what I can see:

Then I checked the page template and this is what I see:

Not sure where you’re getting this from. There are some use statements that are bringing the Setup and Wrapper classes into the current namespace, but other than that I don’t see any references to a roots/sage folder structure in the code you’ve posted.

This code looks like it’s fairly old Sage-wise, and what you’ve posted is mostly just using basic WordPress functions. get_template_part() is a core WordPress function, and it basically just concatenates a couple strings and looks for a template with that filename. For instance get_template_part('template-page', 'home-header-full-width') is just looking in your theme’s folder for the file template-page-home-header-full-width.php, and it looks like that’s that you posted a screenshot of in your second post, but it’s so low-res that I’m having trouble reading it, or understanding why you posted it with no commentary.

When you’re posting code, please don’t post screenshots of it: Just post the code, and then wrap it in three back-ticks, like so:
```
your code
```

And then that lead me to look at this: Roots_Sage

Which it appears like the content is getting pulled from “/roots/sage/…” which I cannot for the life of me find anywhere. Thank you for your help.

It’s not necessary to reply to both of us with the same content; it just appears twice for everyone when you do that.

I apologize. I’m new to this forum…I will reply just once now. This was the content of that blurry image.

<?php use Roots\Sage\Titles; ?>
<?php
$header_image = get_field('header_image', false, true);
$header_image_lg_url = $header_image['sizes']['large'];
// echo '<pre>';
// var_dump($header_image_lg_url);
// echo '</pre>';
?>
<div class="container-fluid page-header-full-width<?php echo $header_image_lg_url != '' ? ' has-image':false?>">
  <div class="bg-image" style="background-image:url('<?php echo get_site_url().$header_image_lg_url; ?>');"></div>

  <div class="row">
    <div class="container">
      <div class="page-header row">
        <div class="col-xs-12 col-sm-8 col-md-6">
          <h1><?= Titles\title(); ?></h1>
          <?php if(has_excerpt()): ?>
            <?php the_excerpt(); ?>
          <?php endif;?>
          <a class="btn btn-default btn-lg" href="<?php echo get_site_url()?>/training/courses/">View Courses</a>
          <!-- <a class="btn btn-primary btn-lg" href="<?php //echo get_site_url()?>/subscribe/">Subscribe</a> -->
        </div>
      </div>
    </div>
  </div>
</div>
<h1><?= Titles\title(); ?></h1>
<?php if(has_excerpt()): ?>
    <?php the_excerpt(); ?>
<?php endif;?>

This is pulling the heading from the title of the page, and the text from the page’s excerpt. The excerpt field didn’t appear in the screenshot you included of the post, but it should be there. It may have been hidden by someone adjusting the Screen Options. You can change that by clicking on the “Screen Options” dropdown in the upper right corner in the admin:
image

The issues you’re describing seem like they’re related to WordPress, not Sage specifically. I’d strongly recommend reading through the WordPress documentation to get an idea of how themes are structured and how they work: Theme Developer Handbook | WordPress Developer Resources

Hey thank you so much. I am pretty good with some of the bigger themes and implementing a child theme. I think my struggle came with your suggestion…that was exactly it.

I inherited this site and it’s definitely not what I am use to…the file structure and just the way things were done just feels so messy and cluttered.

Thank you

This topic was automatically closed after 42 days. New replies are no longer allowed.