Forum Replies Created

Viewing 14 replies - 16 through 29 (of 29 total)
  • If its for the site you linked to. It basically hides the main menu and shows the mobile menu when at mobile screen size. If it is that site. Adding css:

    //hide menu button
    #mobile-nav-button {
       display: none;
    }
    
    //show mobile nav items
    .mobile-nav-container {
      display: block;
    }

    Might give you a starting point/idea. Then just style the list how you want.

    Or you could re-write the markup to suit.

    No probs man, hopefully it doesnt cause any layout issues on other parts of the site. Its a little hacky, I’ll write up some cleaner code if I get a second.

    I basically just renamed a few elements to remove the default styles/layout (CSS) that was being applied to them to work with the feature image ??

    Thread Starter pdg87

    (@pdg87)

    I just realised the values I have above for store_brands are wrong e.g. (Asda, Morrisons, Sainsburys). These should realte to the brands e.g (Ford, Mercedes) Can I not edit this post?

    Thanks Keesie,

    I printed the array for this part and it seemed okay. I think its the fact that the key includes comma seperated values.

    So if I try to compare the array values from store_brands [Ford] [Mercedes]

    with the key brand_names_alt value: [Ford, Fored]

    It is returning none, as it is comparing ‘IN’ and looking for an exact match of the full string, rather than seperate values..

    I just meant the URL, but I found it from the image you posted. Do you know css at all? There is a fixed height on the content wrapper to move it down. The title is also set to white in colour. This should work:
    Change:

    <?php
    /**
     * @package Tesseract
     */
    ?>
    
    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    
    	<?php if ( has_post_thumbnail() && 'post' == get_post_type() ) {
            $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'tesseract-large' ); ?>
            <div class="entry-background" style="background-image: url(<?php echo esc_url( $thumbnail[0] ); ?>)">
                <header class="entry-header">
                    <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
                </header><!-- .entry-header -->
            </div><!-- .entry-background -->
    
        <?php } else { ?>
            <header class="entry-header">
                <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
            </header><!-- .entry-header -->
        <?php } ?>
    
    	<div class="entry-content">
            <div class="entry-meta">
    	        <?php tesseract_posted_on(); ?>
    		</div><!-- .entry-meta -->
    		<?php the_content(); ?>
    		<?php
    			wp_link_pages( array(
    				'before' => '<div class="page-links">' . __( 'Pages:', 'tesseract' ),
    				'after'  => '</div>',
    			) );
    		?>
    	</div><!-- .entry-content -->
    
    </article><!-- #post-## -->

    to:

    <?php
    /**
     * @package Tesseract
     */
    ?>
    
    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    
    	<?php if ( has_post_thumbnail() && 'post' == get_post_type() ) {
            $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'tesseract-large' ); ?>
    <header class="entry-header">
    <?php the_title( '<h1 class="entry-title-single">', '</h1>' ); ?>
    </header><!-- .entry-header -->
        <?php } else { ?>
            <header class="entry-header">
                <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
            </header><!-- .entry-header -->
        <?php } ?>
    
    	<div class="entry-content-single">
            <div class="entry-meta">
    	        <?php tesseract_posted_on(); ?>
    		</div><!-- .entry-meta -->
    		<?php the_content(); ?>
    		<?php
    			wp_link_pages( array(
    				'before' => '<div class="page-links">' . __( 'Pages:', 'tesseract' ),
    				'after'  => '</div>',
    			) );
    		?>
    	</div><!-- .entry-content -->
    
    </article><!-- #post-## -->

    The code needs cleaning up really there is if statement where I dont think its needed (my php is poor)

    you should really add styles to the new title class .entry-title-single

    a quick and dirty inline fix if you want it the same style as other pages just a different colour:

    change

    <?php the_title( '<h1 class="entry-title-single">', '</h1>' ); ?>

    to
    <?php the_title( '<h1 style="color: #000;" class="entry-title">', '</h1>' ); ?>

    Yep if possible?

    Okay, if you change:

    <div class="entry-background" style="background-image: url(<?php echo esc_url( $thumbnail[0] ); ?>)">
                <header class="entry-header">
                    <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
                </header><!-- .entry-header -->
            </div><!-- .entry-background -->

    to:

    <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>

    Or if there is a direct link to the page live? I could probably help more

    okay, Im not sure what your css is for each element. Instead try removing:

    <div class="entry-background" style="background-image: url(<?php echo esc_url( $thumbnail[0] ); ?>)"> <header class="entry-header">.

    and

    </div><!-- .entry-background -->

    add this:

    .nav-collapse.collapse, .no-navbar .nav-collapse {
        background: #000;
    }

    if you want to remove the rounded cornered add this:

    .nav-collapse.collapse, .no-navbar .nav-collapse {
        background: #000;
        border-radius: 0;
    }

    Could you not just remove the following part:

    style="background-image: url(<?php echo esc_url( $thumbnail[0] ); ?>)"

    are you removing the closing </div> and </header> tags when you remove:

    <div class="entry-background" style="background-image: url(<?php echo esc_url( $thumbnail[0] ); ?>)"> <header class="entry-header">

    Thread Starter pdg87

    (@pdg87)

    Sorry Im talking to myself ?? But do I need to add this somehow to use the current post custom field value?

    $value = get_field( “main_atrributes” );

    If so how would I work it into the array?

    Thread Starter pdg87

    (@pdg87)

    When I call ‘main_atrributes’ as a value, will in get the string from every single custom field with this name, rather than for just the page you are on?

    This could be where I’m going wrong.. if so how do I use the custom field only from current post you are viewing?

    Thread Starter pdg87

    (@pdg87)

    Great thanks, it’s Going to be easier for me to try and put this into practice and see how I get on. I’ll report back ??

    Thread Starter pdg87

    (@pdg87)

    Thanks Chad I will look into taxonomies, I had a brief read earlier and seemed to be similar to what I need.

    I could create each offer grouped to a relevant store. But how would I be able to create a page to list these for each store under offers. e.g

    /offers/Store1 (lists all offers for store1)

    /offers/Store2 (lists all offers for store2)

    Would I have to do it manually?

Viewing 14 replies - 16 through 29 (of 29 total)