Page include best practice plus SEO plugin.
-
Hi,
Just registered and new to these forums 🙂 Im currently in the progress of converting my static html5 + css website to wordpress. This is the first time I’m doing this. Everything is working out quite fine so far. My site is a one page website with only a few extra pages. However, i do have a question regarding the SEO plugin and I wanna know if my approach is the best practice approach.
I want the content on my one page website to be managed from within wordpress. I have the following situation, I got three content blocks. These content blocks show 1 paragraph of their complete information. 1 content block is 1 wordpress page. All content blocks have a link to the same page which contains all the information for all three content blocks. This translates in the following:
Pagename: Content – Section 1 – Content block 1
Contains: 1 paragraph for what (pageid 1)
Included in: Index.phpPagename: Content – Section 1 – Content block 2
Contains: 1 paragraph for Who (pageid 2)
Included in: Index.phpPagename: Content – Section 1 – Content block 3
Contains: 1 paragraph for Why (pageid 3)
Included in: Index.phpPagename: Full Page – What/Who/Why
Contains: Full information for all three blocks (pageid 4)
Included in: None. Has it’s on page on page.php, normal wordpress behaviorThe best way for me is to explain this in a picture i think. Check picture here: Picture
The includes on index.php are done with the following code:
<div id=“what”> <?php $my_id = 1; $post_id_1 = get_post($my_id); $content = $post_id_1->post_content; $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); echo $content; ?> </div> <div id=“who”> <?php $my_id = 3; $post_id_3 = get_post($my_id); $content = $post_id_3->post_content; $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); echo $content; ?> </div> <div id=“why”> <?php $my_id = 2; $post_id_2 = get_post($my_id); $content = $post_id_2->post_content; $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); echo $content; ?> </div>
The question i have regarding this approach:
– Is the best way to go about it?
– I don’t want the to be included pages being indexed by Yoast SEO plugin on their own. If they are being indexed it will form a link directly to the page in google, and thus will use page.php to show the page. The page is not intended to be shown this way. So I think i should set the page to not be indexed, however:
– Does Yoast SEO plugin index my full index.php including the included pages if the indexing options for the pages are disabled as per question 2?An alternative to including pages would be using a plugin like “Text Blocks”, however, I also do not know how Yoast will handles these. I know this is somewhat abstract and might be a rather difficult to understand question, please feel free to ask for more information, ill be happy to provide this!
Kind regards and thanks in advanced,
Donny.
- The topic ‘Page include best practice plus SEO plugin.’ is closed to new replies.