WordPress.org

Forums

Customizr
Create custom single.php file (32 posts)

  1. ifixlv
    Member
    Posted 8 months ago #

    Hi. I created my website http://www.ifixlv.com with Customizr theme. Now I found out that i have many errors in Google Webmaster tool - structured data - hentry. In order to fix that I need to modify single.php file which my current theme do not have.

    So I have a question, can I create a single.php file for current theme? If yes, how to do it?

    Is there another version of Customizr that already contains the single.php file?

    PLEASE HELP. REALLY NEED TO FIX THIS.

  2. Matthew
    Member
    Posted 8 months ago #

    The default single.php looks something like this.

    <?php
    /**
     * The Template for displaying all single posts
     *
     * @package WordPress
     * @subpackage Twenty_Fourteen
     * @since Twenty Fourteen 1.0
     */
    
    get_header(); ?>
    
    	<div id="primary" class="content-area">
    		<div id="content" class="site-content" role="main">
    			<?php
    				// Start the Loop.
    				while ( have_posts() ) : the_post();
    
    					/*
    					 * Include the post format-specific template for the content. If you want to
    					 * use this in a child theme, then include a file called called content-___.php
    					 * (where ___ is the post format) and that will be used instead.
    					 */
    					get_template_part( 'content', get_post_format() );
    
    					// Previous/next post navigation.
    					twentyfourteen_post_nav();
    
    					// If comments are open or we have at least one comment, load up the comment template.
    					if ( comments_open() || get_comments_number() ) {
    						comments_template();
    					}
    				endwhile;
    			?>
    		</div><!-- #content -->
    	</div><!-- #primary -->
    
    <?php
    get_sidebar( 'content' );
    get_sidebar();
    get_footer();

    You may want to create a child theme for your current theme and add the single.php to that.

  3. ifixlv
    Member
    Posted 8 months ago #

    Thank you for the quick reply. If I include this single.php file to my Customizr theme, will it effect my website look?

    I found this article, how to fix my structured data problem. http://urbanstoic.com/how-to-fix-google-hfeed-or-hcard-warnings
    But I couldn't find these codexes in Customizr theme:

    <span class="post_date"><?php the_time('j F,Y'); ?></span>
    <span class="theauthor"><?php the_author_posts_link(); ?></span>

    There is no single.php file and my index.php looks like this:

    <?php
    /**
    * The main template file. Includes the loop.
    *
    *
    * @package Customizr
    * @since Customizr 1.0
    */
    ?>
    <?php do_action( '__before_main_wrapper' ); ##hook of the header with get_header ?>
    <div id="main-wrapper" class="<?php echo tc__f( 'tc_main_wrapper_classes' , 'container' ) ?>">

    <?php do_action( '__before_main_container' ); ##hook of the featured page (priority 10) and breadcrumb (priority 20)...and whatever you need! ?>

    <div class="container" role="main">
    <div class="<?php echo tc__f( 'tc_column_content_wrapper_classes' , 'row column-content-wrapper' ) ?>">

    <?php do_action( '__before_article_container'); ##hook of left sidebar?>

    <div id="content" class="<?php echo tc__f( '__screen_layout' , tc__f ( '__ID' ) , 'class' ) ?> article-container">

    <?php do_action ('__before_loop');##hooks the header of the list of post : archive, search... ?>

    <?php if ( tc__f('__is_no_results') || is_404() ) : ##no search results or 404 cases ?>

    <article <?php tc__f('__article_selectors') ?>>
    <?php do_action( '__loop' ); ?>
    </article>

    <?php endif; ?>

    <?php if ( have_posts() && !is_404() ) : ?>
    <?php while ( have_posts() ) : ##all other cases for single and lists: post, custom post type, page, archives, search, 404 ?>
    <?php the_post(); ?>

    <?php do_action ('__before_article') ?>
    <article <?php tc__f('__article_selectors') ?>>
    <?php do_action( '__loop' ); ?>
    </article>
    <?php do_action ('__after_article') ?>

    <?php endwhile; ?>

    <?php endif; ##end if have posts ?>

    <?php do_action ('__after_loop');##hook of the comments and the posts navigation with priorities 10 and 20 ?>

    </div><!--.article-container -->

    <?php do_action( '__after_article_container'); ##hook of left sidebar ?>

    </div><!--.row -->
    </div><!-- .container role: main -->

    <?php do_action( '__after_main_container' ); ?>

    </div><!--#main-wrapper"-->

    <?php do_action( '__after_main_wrapper' );##hook of the footer with get_get_footer ?>

    ANY IDEA WHERE CAN I FIND THESE CODEX IN CUSTOMIZR THEME?

  4. Matthew
    Member
    Posted 8 months ago #

    I am don't know the theme so well but it should have a single.php in it.

  5. ifixlv
    Member
    Posted 8 months ago #

    That is my problem. If it would have a single.php I could modify it. But it does not. Do you know where else I can try to find the codex I need to modify?

    Here is the list of files from my current theme:

    Templates

    Comments
    (comments.php)
    Custom Page Example Page Template
    (custom-page.php)
    Footer
    (footer.php)
    Theme Functions
    (functions.php)
    Header
    (header.php)
    class-fire-init.php
    class-fire-resources.php
    class-fire-utils.php
    class-fire-widgets.php
    Main Index Template
    (inc/index.php)
    init.php
    Main Index Template
    (index.php)
    sidebar-left.php
    sidebar-right.php

    Styles

    Stylesheet
    (style.css)

  6. Matthew
    Member
    Posted 8 months ago #

    The index.php or the custom-page.php maybe.

  7. ifixlv
    Member
    Posted 8 months ago #

    Look, the single.php template you sent me also does not have these codex:

    <span class="post_date"><?php the_time('j F,Y'); ?></span>
    <span class="theauthor"><?php the_author_posts_link(); ?></span>

    What should I do?

  8. ifixlv
    Member
    Posted 8 months ago #

    I checked both index.php (also I sent it to you earlier) and the custom-page.php there is no these codex

    <span class="post_date"><?php the_time('j F,Y'); ?></span>
    <span class="theauthor"><?php the_author_posts_link(); ?></span>

  9. Matthew
    Member
    Posted 8 months ago #

    The theme author would be the best person to answer this.

  10. ifixlv
    Member
    Posted 8 months ago #

    How can I reach the theme author? I went to the theme website but it gives me error when trying to connect to support forum.

    Is there anyone here, who can help me?

  11. Matthew
    Member
    Posted 8 months ago #

    The theme author should respond to this support topic soon (that is if he is a good author).

    You also may find something one his website.

  12. ifixlv
    Member
    Posted 8 months ago #

    Ok. Thank you Matthew. Ill wait for the author respond

  13. ElectricFeet
    Member
    Posted 8 months ago #

    I'm not the author, but I will try to help.

    First off, when you post code, post it in backticks (or use the "code" button). Otherwise you risk breaking this site.

    Now I found out that i have many errors in Google Webmaster tool - structured data - hentry.

    What precisely are the errors?

    In order to fix that I need to modify single.php file which my current theme do not have.

    Why do you think this is the solution?

    So I have a question, can I create a single.php file for current theme?

    It's not likely to help, no.

    Is there another version of Customizr that already contains the single.php file?

    No.

    We need to know what errors you have in order to resolve them.

  14. ifixlv
    Member
    Posted 8 months ago #

    Ok. Thank you for agreeing to help.

    1. I have these errors in Google Webmaster - Structured data - hentry: missing author, missing update

    2. I found this article, how to fix my structured data problem. http://urbanstoic.com/how-to-fix-google-hfeed-or-hcard-warnings

    In this article the solution is to modify author and update codes in the single.php file. My problem is that the Customizr theme does not have that file.

    Is there another solution to remove these errors in Webmaster?

  15. Matthew
    Member
    Posted 8 months ago #

    To fix it, just make a single.php. Have you tried the single.php?

  16. ElectricFeet
    Member
    Posted 8 months ago #

    ifixlv: could you post the full errors from Google? I'm pretty sure that article is not your solution. We've covered this before here, but I need the precise errors to look it up.

  17. ifixlv
    Member
    Posted 8 months ago #

    Matthew: I am not really good with writing codex myself. So i would not be able to create a custom single.php myself. The one you gave me didn't have values for author and update. what is your suggestion?

  18. ifixlv
    Member
    Posted 8 months ago #

    ElectricFeet: here are details from my Webmaster Tool.

    Structured Data > hentry (markup: microformats.org)
    http://www.ifixlv.com/ipod-touch-5-repair-las-vegas-screen-repair/
    Missing: author
    Missing: updated

    http://www.ifixlv.com/ipod-touch-2-repair-las-vegas-screen-repair/
    Missing: author
    Missing: updated

    http://www.ifixlv.com/phone-screen-glass-lcd-repair-las-vegas-smartphone/
    Missing: author
    Missing: updated

    http://www.ifixlv.com/phone-repair/
    Missing: author
    Missing: updated
    /samsung-galaxy-s4-repair-las-vegas-shop-screen/
    Missing: author
    Missing: updated

    http://www.ifixlv.com/ipad-3-repair-las-vegas-screen-glass-repair/
    Missing: author
    Missing: updated

    and so on. i have total 300 errors like this

    It doesn't show me any other information. But that article that I submitted earlier explains my problem in details. But if you want me to submit a screenshot, please, let me know how can I do that

  19. Matthew
    Member
    Posted 8 months ago #

    Can you give me your full index.php from your theme. I will see what I can do.

  20. ifixlv
    Member
    Posted 8 months ago #

    Sure, I sent it to you earlier too. Check the previous message please. here is my full index.php

    <?php
    /**
    * The main template file. Includes the loop.
    *
    *
    * @package Customizr
    * @since Customizr 1.0
    */
    ?>
    <?php do_action( '__before_main_wrapper' ); ##hook of the header with get_header ?>
    <div id="main-wrapper" class="<?php echo tc__f( 'tc_main_wrapper_classes' , 'container' ) ?>">

    <?php do_action( '__before_main_container' ); ##hook of the featured page (priority 10) and breadcrumb (priority 20)...and whatever you need! ?>

    <div class="container" role="main">
    <div class="<?php echo tc__f( 'tc_column_content_wrapper_classes' , 'row column-content-wrapper' ) ?>">

    <?php do_action( '__before_article_container'); ##hook of left sidebar?>

    <div id="content" class="<?php echo tc__f( '__screen_layout' , tc__f ( '__ID' ) , 'class' ) ?> article-container">

    <?php do_action ('__before_loop');##hooks the header of the list of post : archive, search... ?>

    <?php if ( tc__f('__is_no_results') || is_404() ) : ##no search results or 404 cases ?>

    <article <?php tc__f('__article_selectors') ?>>
    <?php do_action( '__loop' ); ?>
    </article>

    <?php endif; ?>

    <?php if ( have_posts() && !is_404() ) : ?>
    <?php while ( have_posts() ) : ##all other cases for single and lists: post, custom post type, page, archives, search, 404 ?>
    <?php the_post(); ?>

    <?php do_action ('__before_article') ?>
    <article <?php tc__f('__article_selectors') ?>>
    <?php do_action( '__loop' ); ?>
    </article>
    <?php do_action ('__after_article') ?>

    <?php endwhile; ?>

    <?php endif; ##end if have posts ?>

    <?php do_action ('__after_loop');##hook of the comments and the posts navigation with priorities 10 and 20 ?>

    </div><!--.article-container -->

    <?php do_action( '__after_article_container'); ##hook of left sidebar ?>

    </div><!--.row -->
    </div><!-- .container role: main -->
    <?php do_action( '__after_main_container' ); ?>

    </div><!--#main-wrapper"-->

    <?php do_action( '__after_main_wrapper' );##hook of the footer with get_get_footer ?>`

  21. ElectricFeet
    Member
    Posted 8 months ago #

    The page you are looking at tells you how to fix problems you don't have.

    Customizr by default adds the author info and the updated info to blog posts (specifically the updated and author classes appear in the "entry-meta" information for each post). This makes sense: you probably want Google to know who wrote the article and when it was updated.

    The links you are pointing to are pages, not posts. As such, it's of lesser importance—and possibly of no importance at all—that Google knows the author and the date of the page. Indeed, many companies would specifically not want authorship information on their static pages.

    Are you sure you want that information on your pages? If so, you could probably get together a small function in the functions.php of your child theme to add the meta information to each page.

  22. ElectricFeet
    Member
    Posted 8 months ago #

    p.s. Post any code using the "code" button or backticks. Otherwise you mess up the forum as it tries to interpret the code you have posted.

  23. ifixlv
    Member
    Posted 8 months ago #

    Hi guys. Here is more detailed view of my problem:

    Extracted structured data
    hatom-feed
    hatom-entry:
    entry-title: Contact iFix LV
    entry-content: Contact iFix LV Cell Phone Computer iPad Screen Repair iFix LV 3909 W Sahara Avenue #6 Las Vegas, NV 89102 Phone: (702) 388-4349 e-mail: support@ifixlv.com View Larger Map Contact iFix LV Contact...
    Error: Missing required field "updated".
    Error: Missing required hCard "author".

    ANYONE? PLEASE, HELP!

  24. ElectricFeet
    Member
    Posted 8 months ago #

    Did you read what I wrote?

  25. ifixlv
    Member
    Posted 8 months ago #

    ElectricFeet: I see what you are saying. It was my first time using google webmater and I thought that these structured data errors will effect my site visibility in SEO. Just the number of 300 errors made me scarred.

    I agree with you that the authorship is not that important for static pages. But do you know for sure, if these errors would effect my web visibility in SEO or no?

  26. ElectricFeet
    Member
    Posted 8 months ago #

    But do you know for sure, if these errors would effect my web visibility in SEO or no?

    Nobody knows for sure, as Google's algorithms are a closely-guarded secret.

    However, I just tested Twenty Fourteen—the default theme provided by WordPress—and Twenty Twelve— the most popular WordPress theme— and note that:
    - The updated class doesn't appear on posts, nor on pages (whereas in Customizr it appears on posts).
    - The author class only appears on posts (as it does in Customizr).

    So in this respect, Customizr is better than two of the most popular themes of all time—for WordPress, which is one of the most popular content management systems of all time.

    So in summary, I wouldn't worry about it if I were you.

  27. Matthew
    Member
    Posted 8 months ago #

    However, I just tested Twenty Fourteen—the default theme provided by WordPress—and Twenty Twelve— the most popular WordPress theme— and note that:
    - The updated class doesn't appear on posts, nor on pages (whereas in Customizr it appears on posts).
    - The author class only appears on posts (as it does in Customizr).

    Is it in any of the themes provided by WordPress?

  28. ElectricFeet
    Member
    Posted 8 months ago #

    No idea. Install them and look at the page source in your browser.

  29. nikeo
    Member
    Theme Author

    Posted 7 months ago #

    Hi @ifixlv, I've found your topic, back from annual vacations.
    To create a custom single.php file, copy, paste and rename the index.php file which includes everything you need.
    If your issue is about Google structured data, you may rather use the hooks API of the theme to fix this.
    Some users solution on this issue :
    http://wordpress.org/support/topic/customizr-and-hfeed-warning?replies=8
    http://harry.subnetworx.de/2014/01/04/wordpress-theme-customizr-missing-required-field-updated/

    @kidsguide (Matthew)

    I am don't know the theme so well but it should have a single.php in it.

    Themes hosted on WP.org can choose whether they include or not some templates of the template hierarchy.
    The template hierarchy can be quite powerful for beginners to quickly create a new page/post template.
    However, after using those templates for a while, I have noticed that they are sources of bugs and hard to maintain because you repeat many times the same code inside different files. The WordPress hooks API combined with the conditional tags, offers an elegant way to keep the code as dry as possible. This is how Customizr has been engineered.
    Yours

  30. admin beritadiblog.com
    Member
    Posted 7 months ago #

    I agree with you that the authorship is not that important for static pages. But do you know for sure, if these errors would effect my web visibility in SEO or no?

Reply »

You must log in to post.

About this Theme

About this Topic