• Hey guys. I’ve been trying for the past 72 hours to implement this function in wordpress but I can’t seem to get it. I need to base the titles of the articles on CATEGORY, DAY, DATE. By the way, in the first code, the DAY is coming up 1 day later (Saturday instead of Friday). I don’t know if you can see anything wrong with it.

    I came up with 2 codes:

    <?php
    $today = get_the_date($d, $the_post->post_parent);
    $day = date("l");
    $categories = get_the_category($postID);
    ?>
    <?php echo $categories[0]->cat_name ?> - <?php echo $day?> - <?php echo $today?>
    1	add_filter( 'default_titlet', 'my_editor_content' );
    2	function my_editor_content( $content ) {
    3	    $content = "If you like this post, then please consider retweeting it or sharing it on Facebook.";
    4	    return $content;
    5	}

    The first code I put in single.php. This added the code perfectly to the title of the post, the problem is in the Dashboard, Category view and anywhere the posts are arrayed (front page for example), the titles still come up blank. I tried adding it to archive.php, category.php, anywhere I thought it would fit.

    The second code I placed in the functions.php file. This worked to add a default title to the editor, which is great, but I can’ get the PHP functions to work. It gives me errors unless I type in nothing but text.

    Ideally, I would like to embed “Category – Day – Date” in the title of each post and block anyone but the admin from changing the title.

    Any suggestions?

    I am using the Noctic theme
    website is http://truthfrequencyradio.com/network

    The website won’t do too much good now though, I just reinstalled the Noctis theme to start fresh.

Viewing 1 replies (of 1 total)
  • Can’t you just place the following in your single.php:
    <?php the_category(); ?><?php the_date(); ?><?php the_title(); ?>

Viewing 1 replies (of 1 total)
  • The topic ‘Default Title in all posts??’ is closed to new replies.