I am presently attempting to remove/comment a markup of within the mind portion of wordpress.

Here's my function.

function strip_style() { ?>
    <?php

    $commented_style = str_replace("<link rel="stylesheet" type="text/css" href="http://localhost/wp-content/themes/headway-208/style.css" />", "<!-- <link rel="stylesheet" type="text/css" href="http://localhost/wp-content/themes/headway-208/style.css" /> -->", $rawstring);

    echo commented_style;

    ?>
<?php
}

add_action('wp_head', 'strip_style', 1);

I can not also employ wp_enqueue_style and wp_deregister_style because the line i'm attempting to remove is difficult-coded using the parent theme.

Essentially I wish to disable the default css (styles.css) its loading in order to use my very own style and never override the default style.

Please advice if my approach of utilizing str_replace() is nice or otherwise. Are you able to suggest an alternate?

Thanks!

Just copy header.php file inside your child theme and edit out that which you don't want to look. For those who have header.php both in child and parent theme, the main one in child theme is going to be used. That counts for those files. If you wish to edit any one of parent theme files just copy it into child theme and edit them there.

So far as css is conserned, in mind first parents theme style.css is going to be linked and below it child theme style.css so every rule with same specificity in child theme will override parent theme rule, no requirement for any mambo-jumbo dirty miracle.

Maybe I am not fully understanding, but why not just copy the present theme folder, relabel it making your personal theme by wiping the design and style.cascading stylesheet and begin again as you would like?

Regardless, if you have to do the str_replace(), your code is wrong. First of all, your PHP tags are everywhere, and also you can't nest them. Next, your strings will not parse correctly since you are utilizing double quotes in the double-cited string. Fixed and simplified:

<?php

function strip_style() {
    $link = '<link rel="stylesheet" type="text/css" href="http://localhost/wp-content/themes/headway-208/style.css" />';
    echo str_replace($link, '<!-- ' . $link . '-->', $rawstring);

    // But where does $rawstring come from?
}

?>

.

<?php

    add_action('wp_head', 'strip_style', 1);

?>