[help!] WP theme customization problems&questions

terrycody

Elite Member
Joined
Sep 29, 2012
Messages
6,423
Reaction score
3,324
hey guys

I'm doing customization of some wordpress themes, as we all know, even paid themes, you may still need a lot of tweaks and customization on the theme PHP code, sadly, I am not a coder, I dunno PHP (and I can only read some HTML though).

I have a very hard time to solve problems regard customization, I googled hours and still can't figure many things, I would love to hear your thoughts, thanks!


Question 1

when you want to remove some parts in the theme, e.g. comment section (include no comment tag under the Title), I searched online and many guides use CSS to hide the class, is this good? We know Google index HTML pages not the page we see, so the exact code is still there, as well as the junk links like: www.aaa.com/post&respond etc

So I guess the best way to do this, is remove the function in the theme right? Well this is a hard job for me, as this requires some PHP knowledge at least.

Question 2

Do you show author and date tag of your posts? This is a long argue I won't talk much, in short many people in evergreen niche like health etc tend to not show date or author tags, I am still considering this, to keep it or remove it, at least I want to dis-clickable the author tag link (to do list)

I'd love to hear your thoughts on date tags on evergreen niche.

(I know a better way maybe turn write on to ----> upgraded on, but my theme is very weird, it has no text, just date lol, so I have to edit PHP code again, which stuck me hours till now, each time I want to add some text, it shows wrong PHP syntax, damn it!)

Question 3

Yoast SEO has many functions and sometimes, very confusing to configure. As such, when setting author function, I disabled the author page, and want to disable the clickable link author tag below the Title, I think this is a good practice, what's your opinion guys?

BTW, I am using Point theme, https://wordpress.org/themes/point/ , one of the my themeshop themes, I know they got support forum, just very clunky to use...
 
Code:
$posted_on = sprintf(
            // Translators: Date.
            esc_html_x( 'Posted on %s', 'post date', 'point' ),
            '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>'
        );

        $byline = sprintf(
            // Translators: Author Name.
            esc_html_x( 'by %s', 'post author', 'point' ),
            '<span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . esc_html( get_the_author() ) . '</a></span>'
        );

        echo '<span class="posted-on">' . $posted_on . '</span><span class="byline"> ' . $byline . '</span>'; // WPCS: XSS OK.

No idea if I am right or not, I found this snippet of my theme in the template-tags.php file, I think this is the right place, I want to add some text before the "date tag", for example, updated on "2018.12.12", I tried but always prompted with wrong syntax, so I think I need learn PHP lol ?

Any helps ?
 
so I am struggled to find these code, and yes they DID work

Code:
.post-info {
display:none;
}

.meta {
display:none;
}


But a bad feeling if use these CSS tricks to hidden the unwanted meta text here and there, because in your HTML file, the exact code snippet is still there, just hidden not deleted, I am wondering if this trick will trigger bad SEO practice, as already talked a lot in the Google, no exact answer from I searched.

PS: I know a plugin named wp meta date and author remover.
 
so I am struggled to find these code, and yes they DID work

Code:
.post-info {
display:none;
}

.meta {
display:none;
}


But a bad feeling if use these CSS tricks to hidden the unwanted meta text here and there, because in your HTML file, the exact code snippet is still there, just hidden not deleted, I am wondering if this trick will trigger bad SEO practice, as already talked a lot in the Google, no exact answer from I searched.

PS: I know a plugin named wp meta date and author remover.
You do realise you need to make changes in a child theme, or the next time you update it will be all gone and you'll have to do it all over again, in fact you'll need to keep doing it. Read this
https://codex.wordpress.org/Child_Themes
 
You do realise you need to make changes in a child theme, or the next time you update it will be all gone and you'll have to do it all over again, in fact you'll need to keep doing it. Read this
https://codex.wordpress.org/Child_Themes

Yeah thx dude, I know that, my current knowledge will have a hard time on child theme set up, so I will tackle that issue when I got enough time, that's why I will record everything I done to my theme, so easy to fix when update :)

btw, I thought u reminded me before regard this thing, maybe 1-2 years ago lol
 
Successfully removed the useless meta date (author, date, no comment etc) under the title line, but in the homepage, related posts snippet still show author and date, so I think I need find the right "theme file" and remove those meta code again, but which one?

That means, which file controls homepage contents ?

Update: clear, in index.php :rolleyes:

Damn it there is none such option, wtf?!

Code:
<?php
/**
 * The main template file.
 *
 * Used to display the homepage when home.php doesn't exist.
 */

get_header(); ?>

<div id="page" class="home-page">
    <div class="content">
        <div class="article">

            <h3 class="frontTitle"><div class="latest"><?php esc_html_e( 'Latest', 'point' ); ?></div></h3>

            <?php
            if ( have_posts() ) :
                /* Start the Loop */
                while ( have_posts() ) :
                    the_post();

                    get_template_part( 'template-parts/content' );
                endwhile;

                point_post_navigation();
            else :
                get_template_part( 'template-parts/content', 'none' );
            endif;
            ?>

        </div><!-- .article -->
        <?php
        get_sidebar();
        get_footer();
        ?>

:oops:
 
Last edited:
Back
Top