Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter jasonTakesManhattan

    (@jasontakesmanhattan)

    I tried the custom single event file, but I’m still just getting a blank white page when I click on an event.

    Since this works fine when tested with other themes, I feel like there has to be something minor that I’m missing here.

    And I actually don’t even necessarily need the event details page. Is there a way to disable to hover pop that shows up in the widget when hovering over an event title?

    Thread Starter jasonTakesManhattan

    (@jasontakesmanhattan)

    My site seems to be suddenly working again, too. And this particular site is also hosted through iPage, and my issue began on the 8th or 9th. It had to be something on iPage’s end.

    @keithdriscoll I’m not using any caching plugins, and I’m not using any content delivery networks. This issue seems to have resolved itself at the moment, unless iPage support did something to fix it without telling me. I’ll post the url if I end up having any more issues.

    Thanks.

    Thread Starter jasonTakesManhattan

    (@jasontakesmanhattan)

    It appears to be working now. You were correct in that jQuery was not loading. This didn’t make sense, though, because the function requires a dependency on jQuery being loaded first. I ended up getting it to work by adding a call to enqueue jquery in my main function. This was the final function:

    function my_map_scripts() {
    	if ( is_page_template( 'template-project-map.php' ) ) {
    			// Load jQuery
    		if ( !is_admin() ) {
    		   wp_deregister_script('jquery');
    		   wp_register_script('jquery', ("https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"), false);
    		   wp_enqueue_script('jquery');
    		}
    		wp_enqueue_script(
    			'jplist-custom-script',
    			get_stylesheet_directory_uri() . '/js/jplist.min.js',
    			array( 'jquery' )
    		);
    		wp_enqueue_script(
    			'jlocator-custom-script',
    			get_stylesheet_directory_uri() . '/js/jlocator.min.js',
    			array( 'jquery' )
    		);
    		wp_enqueue_script(
    				'google-maps',
    				'https://maps.googleapis.com/maps/api/js'
    			);
    		wp_enqueue_script(
    			'jlocator-activate-script',
    			get_stylesheet_directory_uri() . '/js/jlocator.activate.js',
    			array( 'jquery' )
    		);
    
    	}
    }
    
    add_action( 'wp_enqueue_scripts', 'my_map_scripts' );
    Thread Starter jasonTakesManhattan

    (@jasontakesmanhattan)

    Can you tell me where you are viewing those 404 errors? In the browser console, I am seeing that the Google Maps API may be loading multiple times, but I’m not sure how. I’ve only called it once, and there are no active google maps plugins. And then, of course, it’s telling me that $ is not a function in my jlocator.min.js file.

    Thread Starter jasonTakesManhattan

    (@jasontakesmanhattan)

    Right now you’ll see the list of locations on the left, and a blank map on the right. Once I get the jQuery functioning properly, the list on the left will become paginated, and the map will kick in with markers.

    Thread Starter jasonTakesManhattan

    (@jasontakesmanhattan)

    Here is the link: Development site

    I agree with you that it seems like jQuery isn’t loading, but I’ve even tested to make sure jQuery is loading, in order to execute the function (in the functions.php file), and it still ran. I’ve never had a problem like this with jQuery and WordPress.

    If you can take a look, I would appreciate it.

    Thread Starter jasonTakesManhattan

    (@jasontakesmanhattan)

    Ok. I was confused about the backticks. I’ll post in the ACF support forum.

    I did try to output the image using the image object code, but that didn’t work either.

    Thread Starter jasonTakesManhattan

    (@jasontakesmanhattan)

    I tried altering the “return” line above, but that didn’t work either. And just to give you a visual of what is happening in my code, this is the code that is output whenever I add a caption to an image in my post:

    <div class="news-article">
    
    <div attachment_122class="wp-caption alignleft" >
    <a href="https://dev2.mysite.com/wp-content/uploads/2013/07/about-tanks.jpg" rel="lightbox[184]" title="Testing the post again"><img class="size-full wp-image-122" alt="New fermentation tanks at Helltown." src="https://dev2.mysite.com/wp-content/uploads/2013/07/about-tanks.jpg" /></a>
    <p class="wp-caption-text">New fermentation tanks at Helltown</p></div>
    <p style="text-align: left;">his is Photoshop’s version of Lorem Ipsum. Proin gravida nibh vel velit auctor aliquet. Aenean sollicitudin, lorem quis bibendum auctor, nisi elit consequat ipsum, nec sagittis sem nibh id elit. </p>
    
    </div>

    And again, that problem area is the part the reads:

    <div attachment_class122=”wp-caption alignleft”>

    I can’t style wp-caption or alignleft when it is written like this.

    Thread Starter jasonTakesManhattan

    (@jasontakesmanhattan)

    I’m building a custom theme, and I started from a blank wordpress theme. I took a look at the media.php file and this is the code for captions:

    function img_caption_shortcode($attr, $content = null) {
    	// New-style shortcode with the caption inside the shortcode with the link and image tags.
    	if ( ! isset( $attr['caption'] ) ) {
    		if ( preg_match( '#((?:<a [^>]+>\s*)?<img [^>]+>(?:\s*</a>)?)(.*)#is', $content, $matches ) ) {
    			$content = $matches[1];
    			$attr['caption'] = trim( $matches[2] );
    		}
    	}
    
    	// Allow plugins/themes to override the default caption template.
    	$output = apply_filters('img_caption_shortcode', '', $attr, $content);
    	if ( $output != '' )
    		return $output;
    
    	extract(shortcode_atts(array(
    		'id'	=> '',
    		'align'	=> 'alignnone',
    		'width'	=> '',
    		'caption' => ''
    	), $attr));
    
    	if ( 1 > (int) $width || empty($caption) )
    		return $content;
    
    	if ( $id ) $id = 'id="' . esc_attr($id) . '" ';
    
    	return '<div ' . $id . 'class="wp-caption ' . esc_attr($align) . '" style="width: ' . (10 + (int) $width) . 'px">'
    	. do_shortcode( $content ) . '<p class="wp-caption-text">' . $caption . '</p></div>';
    }

    Is it the variable $id that is adding attachment_xxx before the class? Would something like this possibly work?

    return '<div id="' . $id . '" class="wp-caption ' ...........

    I’m not 100% sure what $id is outputting, but I figure it has to be the attachment name. I just want to assign that attachment name as the id instead of something like attachment_xxxclass=”wp-caption…..

    I also have read that editing the media file could be a problem when updating wordpress, as it will just overwrite the file. Is that the case?

Viewing 9 replies - 1 through 9 (of 9 total)