0

I am trying to customise my Wordpress homepage.

I decided to get fullscreen image theme (TwoFold by Fuel Themes). As I am preparing photography portfolio website, graphic content is very important to me. However, I'd like to add some text below the image slider, ideally it would be a whole page below the current homepage slider. Please see the demo theme: TwoFold Theme

And what I would like to add (simple mockup):

Desired layout

Methods I found here seem not to work well - they extend bottom of the homepage, however return no content below the slider.

Let's say I'd like to insert "About" page under the slider. How should I modify home page layout to do that?

Orignal code below:

<?php
/*
Template Name: Home
*/
?>
<?php get_header(); ?>
<?php if (have_posts()) :  while (have_posts()) : the_post(); ?>
<?php 
    $id = get_the_ID();
    $home_layout = get_post_meta($id, 'home_layout', true) ? get_post_meta($id, 'home_layout', true) : 'style1';
    get_template_part( 'inc/templates/homepage/'.$home_layout );
?>
<?php endwhile; else : endif; ?>
<?php get_footer(); ?>

Lots of thanks for any hints as I am clueless.

2
  • What have you tried so far? Add a div with some dummy content right after your endif and above get_footer(). If you do not see the content, inspect it with developer tools and determine what CSS you may need to adjust.
    – WebElaine
    Commented Dec 6, 2017 at 15:58
  • Open this file: inc/templates/homepage/. Add your content there. Commented Dec 6, 2017 at 17:12

2 Answers 2

1

Your theme is dynamically loading a template part.

Look here:

   $home_layout = get_post_meta($id, 'home_layout', true) ? get_post_meta($id,'home_layout', true) : 'style1';
get_template_part( 'inc/templates/homepage/'.$home_layout );

Now look in your folder at inc/templates/homepage/ and you should see the various template parts.

Those templates parts are where you'll want to add your new code (for the about page).

3
  • Thanks Tim and WebElaine! It worked. I added <div> with <object> to the ../homepage/style1.php. It looks great, however I wanted to SEO optimise that added content. Google crawler seem to skip that part. Is that any way to improve that?
    – j.radke
    Commented Dec 6, 2017 at 18:38
  • Give Yoast SEO a look maybe Commented Dec 8, 2017 at 6:03
  • Yoast SEO won't read the content neither in <object> nor in <iframe>...
    – j.radke
    Commented Dec 8, 2017 at 9:06
1

It worked almost as I wanted, thank you for the comments!

Almost - therefore I have one more question. (I am sorry if that is obvious, I am not experienced and I am learning everything just now, I already learnt a lot and I want to learn more as currently I cannot afford paying for these modifications).

I tried two method:

Method 1 - inserting separate (non-WP) page in div and iframe into style1.php - it looks exactly as I wanted:

enter image description here

However returned content is not seen by Google bot, not seen by WP Admin and WP Plugins, which makes all very difficult to optimise.

Method 2 - echoing other WP page with desired content by:

<?php
$your_query = new WP_Query( 'pagename=about' );
while ( $your_query->have_posts() ) : $your_query->the_post();
    the_content();
endwhile;
wp_reset_postdata();?>

What returned raw text:

enter image description here

which is visible for Google bot, WP engine etc.

My question is: How do I return formatted page that is visible for Google, WP, plugins etc.?

I know that it may be simple, however I achieved a lot already and I'd like to finalise whole project with your help and my good will.

Many thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.