Forum Replies Created

Viewing 15 replies - 16 through 30 (of 40 total)
  • Thread Starter 83creative

    (@winnard)

    Hi,

    Hoping somebody can help me with this issue as I am still struggling to pull out the correct template file for this particular problem.

    Could it possibly be a custom search.php template that would be used?

    I am really not sure. I am wondering whether to contact the Search & Filter plugin page to see if there is a template I should be using.

    Could I add conditionals into the current archive.php to display either blog posts, or CPT?

    Can anybody help me with this issue?

    Thread Starter 83creative

    (@winnard)

    For those that need the same functionality here is the code that works for me.

    <?php
    	if ( has_post_thumbnail() ) :
    		$image_array = wp_get_attachment_image_src( get_post_thumbnail_id(), array('blog'), false, '' );
    		$image = $image_array[0];
    	else :
    		$image = get_template_directory_uri() . '/images/default.jpg';?>
    	<style type="text/css">
    		.featured-img {
    			height:280px;
    			border-bottom:1px solid #b6b6b6;
    			background:
    			linear-gradient(
    			  rgba(33, 33, 33, 0.5),
    			  rgba(33, 33, 33, 0.5)
    			),
    			url('<?php echo $image ?>') no-repeat 50% 50% #212121;
    			background-size:cover;
    		}
    	 </style>
    	<?php endif;?>

    Glad you got it sorted.

    Are you using a child theme? If not I am guessing you will be able to edit the footer.php template file.

    Thread Starter 83creative

    (@winnard)

    Ok as an update as I hadn’t heard from anyone regarding this, I managed to cobble together a perfect solution for me and thought I would add the code here in case anybody else ever needed to use the same issue.

    What the code does simply is remove the Gallery Shortcode from the loop, so that we can add it back into our theme template wherever we need to. In my case add the gallery into another column.

    The reason I have done it this way is for client usability. I want the client to just use the editor to add a gallery, anywhere they want to in the content without it breaking the layout.

    So here goes

    1st step — (Add this to your theme’s functions.php)

    // Deletes first gallery shortcode and returns content
    function  strip_shortcode_gallery( $content ) {
        preg_match_all( '/'. get_shortcode_regex() .'/s', $content, $matches, PREG_SET_ORDER );
        if ( ! empty( $matches ) ) {
            foreach ( $matches as $shortcode ) {
                if ( 'gallery' === $shortcode[2] ) {
                    $pos = strpos( $content, $shortcode[0] );
                    if ($pos !== false)
                        return substr_replace( $content, '', $pos, strlen($shortcode[0]) );
                }
            }
        }
        return $content;
    }

    This part strips the Gallery Shortcode from the content. We replace <?php the_content();?> in our theme with…

    <?php
    $content = strip_shortcode_gallery( get_the_content() );
    $content = str_replace( ']]>', ']]>', apply_filters( 'the_content', $content ) );
    echo $content;
    ?>

    Step 2.

    We grab that Gallery shortcode and add it where we need too in the opposite column in my case.

    Add this to your functions.php file in your theme.

    // Return first gallery shortcode
    function get_shortcode_gallery ( $post = 0 ) {
        if ( $post = get_post($post) ) {
            $post_gallery = get_post_gallery($post, false);
            if ( ! empty($post_gallery) ) {
                $shortcode = "[gallery";
                foreach ( $post_gallery as $att => $val ) {
                    if ( $att !== 'src') {
                        if ( $att === 'size') $val = "thumbnail";        // Set custom attribute value
                        $shortcode .= " ". $att .'="'. $val .'"';   // Add attribute name and value ( attribute="value")
                    }
                }
                $shortcode .= "]";
                return $shortcode;
            }
        }
    }

    We then place the following code where we need it to go in our theme template file.

    <?php  if(shortcode_exists( 'gallery' )) {
    	echo do_shortcode( get_shortcode_gallery() );
    }  ?>

    Ok so whilst this probably isn’t the neatest solution, myself being low-level skill wise with PHP; it works as I need it too. Hope it can help somebody else or used for something to build upon.

    Cheers Dan

    Thread Starter 83creative

    (@winnard)

    Still haven’t been able to find a solution for this. Must be able to do this just need to drag the shortcode out of the loop.

    Hi Obane,

    Where do you need to place the Hello Bar?

    Do you have access to the theme files to edit them?

    Cheers

    Dan

    Is this the bootstrap Jumbotron?

    You could be specific with your theme CSS and add the following.

    .jumbotron h1 {
    color: #000000;
    }

    Just change the color to the relevant hex value.

    Hope that helps.

    Cheers
    Dan

    Hi Eva,

    What do you have your media settings set at in your dashboard? Not sure if this maybe causing the issue.

    The theme itself seems to work as expected on the demo i viewed, but has a range of image sizes on its demo page.

    Maybe you could try adding in a large image into the slider and seeing if this makes a difference, or alternatively see if you can get the demo content from the free theme to test how they have done it.

    If I get chance I will download the theme and take a look at it for you.

    Bear with me or let me know how you get on. It could well be a settings thing in NextGen plugin causing the output of different sizes in the CSS which is constraining the images.

    Sorry I cannot be more help.

    Dan

    Hi Eva,

    What is the area you are wishing to make bigger? Is it the images?

    Dan

    Hi marties,

    Do you have any margin-top on the main menu ul element?

    Sometimes this can cause a flickering effect.

    Cheer Dan

    If you are talking about the Intro content that goes over the bog image on the right hand side of the theme. (I am lookig at the theme demo) You can change the following font-size in your child theme css stylesheet to the following..

    .album-info-block .album-content {
    font-size: .875em;
    line-height: 1.6em;
    margin: 0;
    }

    If you change the font-size from .875em to something else it should still be responsive due the em value. Given that em values are relative.

    Hi Eva,

    Do you have a screenshot or link to the part you need to change?

    Dan

    Hey Bojan,

    Whilst your in super help mode on the forum today, any chance you can take a look at my issue?

    It is posted in the Theme and Templates a little further down the list than this post.

    Cheers

    Dan

    Hi emugera,

    It seems you have sorted the top navigation. ??

    Post here if you need any other help.

    Cheers,
    Dan

Viewing 15 replies - 16 through 30 (of 40 total)