fuck wordpress

Sometimes, you just want to make a simple change to wordpress and their templates. And then you want to die because you know nothing about wordpress and their stupid ass hierarchy. And instead of actually learning about templates, their hierarchy and all that shit, I’d rather get mad.

But to solve my problem I actually had to learn about wordpress. Maybe I just hate blog platforms. Ghost, wordpress, rolling my own. It doesn’t matter, each of them piss me off in different ways. At least when I roll my own blog, I know what I’ve created and I don’t have to get mad at anyone but myself when something fucks up.

This blog is also a way for me to blow off steam. I mean all I want to do is remove the fucking word Category from the h1 tag on my Wordpress Category page BECAUSE THAT WORD IS FUCKING UP THE SEO.

So I dive into the wordpress and I finally find the function I’m looking for…

get_the_archive_title

located in /wp-includes/general-template.php

Look at this function. Jesus, looks like a nightmare.

function getthearchivetitle() {
        if ( iscategory() ) {
                $title = sprintf( _( 'Category: %s' ), singlecattitle( '', false ) );
        } elseif ( istag() ) {
                $title = sprintf( _( 'Tag: %s' ), singletagtitle( '', false ) );
        } elseif ( isauthor() ) {
                $title = sprintf( _( 'Author: %s' ), '' . gettheauthor() . '' );
        } elseif ( isyear() ) {
                $title = sprintf( _( 'Year: %s' ), getthedate( _x( 'Y', 'yearly archives date format' ) ) );
        } elseif ( ismonth() ) { 
                $title = sprintf( _( 'Month: %s' ), getthedate( _x( 'F Y', 'monthly archives date format' ) ) );
        } elseif ( isday() ) {
                $title = sprintf( _( 'Day: %s' ), getthedate( _x( 'F j, Y', 'daily archives date format' ) ) );
        } elseif ( istax( 'postformat' ) ) {
                if ( istax( 'postformat', 'post-format-aside' ) ) {
                        $title = _x( 'Asides', 'post format archive title' );
                } elseif ( istax( 'postformat', 'post-format-gallery' ) ) { 
                        $title = _x( 'Galleries', 'post format archive title' );
                } elseif ( istax( 'postformat', 'post-format-image' ) ) {
                        $title = _x( 'Images', 'post format archive title' );
                } elseif ( istax( 'postformat', 'post-format-video' ) ) {
                        $title = _x( 'Videos', 'post format archive title' );
                } elseif ( istax( 'postformat', 'post-format-quote' ) ) {
                        $title = _x( 'Quotes', 'post format archive title' );
                } elseif ( istax( 'postformat', 'post-format-link' ) ) {
                        $title = _x( 'Links', 'post format archive title' );
                } elseif ( istax( 'postformat', 'post-format-status' ) ) { 
                        $title = _x( 'Statuses', 'post format archive title' );
                } elseif ( istax( 'postformat', 'post-format-audio' ) ) {
                        $title = _x( 'Audio', 'post format archive title' );
                } elseif ( istax( 'postformat', 'post-format-chat' ) ) {
                        $title = _x( 'Chats', 'post format archive title' );
                }
        } elseif ( isposttypearchive() ) {
                $title = sprintf( _( 'Archives: %s' ), posttypearchivetitle( '', false ) );
        } elseif ( istax() ) {
                $tax = gettaxonomy( getqueriedobject()->taxonomy );
                /* translators: 1: Taxonomy singular name, 2: Current taxonomy term */
                $title = sprintf( _( '%1$s: %2$s' ), $tax->labels->singularname, singletermtitle( '', false ) );
        } else {
                $title = __( 'Archives' );
        }

And all I want to do is change

$title = sprintf( __( 'Category: %s' ), single_cat_title( '', false ) );

to

$title = sprintf( __( '%s' ), single_cat_title( '', false ) );

So I found out that my category page was being displayed by archive.php because none of the other template files existed.

https://developer.wordpress.org/themes/basics/template-hierarchy/#category

And when I opened that file, I found out it was using the get_the_archive_title function. Which when I googled that shit, I found out the get_the_archive_title function is located in the /wp-includes/general-template.php file. So I opened that file, edited the function and EVERYTHING IS HAPPY.

EXCEPT… when I update wordpress, all my changes will probably disappear. Any when that happens, I’ll probably want to punch someone. But until then…

I gotta hand it to Wordpress for making a great blogging platform, but sometimes you make me want to throw my fucking computer off the World Trade Center.

Post Content