Some PHP help - merge code

Scorpion Ghost

Elite Member
Executive VIP
Jr. VIP
Joined
Mar 22, 2013
Messages
9,144
Reaction score
10,489
I have this code:

PHP:
                        <p class="author-post">
                            <?php
                                printf( __( 'Posted by %s in %s on ', 'enginethemes' ),
                                    get_the_author(),
                                    get_the_category_list( __( ', ', 'enginethemes' ) )
                                );
                            ?>
                        </p>

                                                    <p class="date-post"><?php the_time('M j');  ?> <sup><?php the_time('S');?></sup>, <?php the_time('Y');?></p>

It makes this:

asd.PNG


I would like it to make this:

cxv.PNG


I'm 99% sure the code can be merged together to make this, but I don't really know PHP. The things I try generally break the entire page/site :p

Can anyone help?
 
Oh shit never mind I fixed it:

PHP:
                            <?php
                                printf( __( 'Posted by %s in %s on ', 'enginethemes' ),
                                    get_the_author(),
                                    get_the_category_list( __( ', ', 'enginethemes' ) )
                                );
                                

                                
                            ?>
                            
                            <?php the_time('M j');  ?> <sup><?php the_time('S');?></sup>, <?php the_time('Y');?>
                            
                        </p>

Wow. It was just easier when I looked at the code here in the BHW code thing, with the different colors separating things nicely. Wow okay good good :D
 
Just try this, mate:
PHP:
                        <p class="author-post">
                            <?php
                                printf( __( 'Posted by %s in %s on ', 'enginethemes' ),
                                    get_the_author(),
                                    get_the_category_list( __( ', ', 'enginethemes' ) )
                                );
                            ?>
                                <?php the_time('M j');  ?> <sup><?php the_time('S');?></sup>, <?php the_time('Y');?>
                        </p>
 
Just try this, mate:
PHP:
                        <p class="author-post">
                            <?php
                                printf( __( 'Posted by %s in %s on ', 'enginethemes' ),
                                    get_the_author(),
                                    get_the_category_list( __( ', ', 'enginethemes' ) )
                                );
                            ?>
                                <?php the_time('M j');  ?> <sup><?php the_time('S');?></sup>, <?php the_time('Y');?>
                        </p>

Yeah yeah that was it got it thanks :D
 
Back
Top