• Chris

    (@cutcabletoday)


    Okay, so I am redoing my homepage and trying to have a section where there is an image with bout 4 words next to it. I need the image + the words to be centered together on the same line. Is this possible?

    The page is just in draft so I cannot post a link. However, it’s just a basic image and then some h3 text.

Viewing 14 replies - 16 through 29 (of 29 total)
  • Good. try to access this directory:
    wp-content/themes/mh_newsdesk

    and edit this file: functions.php

    Tell me how you placed the code, because I believe you didn’t place it well.

    Thread Starter Chris

    (@cutcabletoday)

    This is at the bottom of the file

    function cc_recommends( $atts ) {
    	$a = shortcode_atts( array(
            'text' => 'something',
            'url' => 'something else',
            'urltext' => 'something else again',
        ), $atts );
    	ob_start();
    ?>
    <style type="text/css">
    .ct-recommends {
    	text-align: center;
        display: block; border: 1px solid #BEBEBE;
        border-width: 1px 0;
        overflow: hidden;
        width: 100%;
    }
    .ct-recommends div {
    	display: inline-block;
    	max-width: 50%;
    	vertical-align: -webkit-baseline-middle;
    	vertical-align: middle;
    }
    </style>
    <div class="ct-recommends">
    	<div>
    		<img class="wp-image-1644 alignleft lazy-loaded" src="https://www.cutcabletoday.com/wp-content/uploads/2015/06/MrCCT-Head1.png" data-lazy-type="image" data-src="https://www.cutcabletoday.com/wp-content/uploads/2015/06/MrCCT-Head1.png" alt="Mr. Cable Cutter" width="110" height="121"><noscript><img class=" wp-image-1644 alignleft" src="https://www.cutcabletoday.com/wp-content/uploads/2015/06/MrCCT-Head1.png" alt="Mr. Cable Cutter" width="110" height="121" /></noscript>
    	</div>
    	<div>
    		<?php echo "<h3>{$a['text']}&nbsp;<a href=\"{$a['url']}\">{$a['urltext']}</a></h3>\n"; ?>
    	</div>
    </div>
    <?php
    	return ob_get_clean();
    }
    
    add_shortcode('cc-recommends', 'cc_recommends');

    tell me what’s right above this code? is it a PHP closing tag ( ?> ) ?
    If yes, remove it.

    Thread Starter Chris

    (@cutcabletoday)

    If I just remove it and save, would my site go back up?

    Thread Starter Chris

    (@cutcabletoday)

    yes that is there. i removed it and saved.

    Sorry, if you don’t have access to the admin area, just remove the code you added from the start, for the shortcode, and I will try to set you up a quick plugin instead or see something else..

    Thread Starter Chris

    (@cutcabletoday)

    Ok, site is back up. That was a scare! Thanks for walking me back through

    You’re welcome. let me set you up a quick plugin and give you a download link.

    Thank you too.

    Here’s your download link:
    https://s.elegance-style.com/mccr-shortcodes.zip

    Note: the file will be removed in future.

    Thread Starter Chris

    (@cutcabletoday)

    Hey Samuel, I still cannot access my WP dashboard. When I type in the URL I normally go to, it just comes up blank. Any ideas how to fix?

    I am sorry to hear about that.
    Again, if the plugin was causing that, just login to FTP and go to wp-content/plugins/ and delete mccr-shortcodes folder

    I am sorry about the bad experience

    Thread Starter Chris

    (@cutcabletoday)

    I did not add the plug-in yet. My site is up and running but when i put in the web address with /wp-admin it is a blank white screen. Any idea of how to get it back?

    Maybe you did something in the functions.php file.. you can restore that file with a fresh copy from your theme

    Thread Starter Chris

    (@cutcabletoday)

    Fixed….I’ve decided I’m not messing with this anymore right now!

Viewing 14 replies - 16 through 29 (of 29 total)
  • The topic ‘Need to center both image and text side by side’ is closed to new replies.