Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter mgargiullo

    (@mgargiullo)

    Thank you.

    Thread Starter mgargiullo

    (@mgargiullo)

    I can’t just touch the css unfortunately as the function that creates the 3 style post title assigns a style to each piece.

    Image of Post Title

    The title of the post is entered like so:
    Aegilops cylindrica|jointed goat-grass|Poaceae

    This function beaks it apart and reformats it.

    function change_post_title($title) {
    	if(doing_filter('cmtt_tooltip_content_add')){ return $title; }
    	$cpt_tmp_title=explode("|",$title);
    	if ( in_the_loop() ) {
                    return " <span class=\"mtitle-latinname\">".$cpt_tmp_title[0]." </span><span class=\"mtitle-commonname\">".$cpt_tmp_title[1]." </span><span class=\"mtitle-familyname\">".$cpt_tmp_title[2]."</span>";
            }
    }

    At the bottom of the page, the post navigation is also formatted like the title:

    Post Navigation

    I’d like to modify the post navigation titles. Obviously the post navigation uses titles as it gets formatted. I’m looking for the right IF statement to use to identify when we’re modifying the titles used in post navigation or specifically the post title shown at the top of the page.

    In the code above, I already have a check in the function so I don’t modify the glossary terms.

    Ideally it would look like this (pseudo code):

    function change_post_title($title) {
    	if(doing_filter('cmtt_tooltip_content_add')){ return $title; }
    	$cpt_tmp_title=explode("|",$title);
    	if ( in_the_loop() ) {
                    if(this is the main post title){
                            return " <span class=\"mtitle-latinname\">".$cpt_tmp_title[0]." </span><span class=\"mtitle-commonname\">".$cpt_tmp_title[1]." </span><span class=\"mtitle-familyname\">".$cpt_tmp_title[2]."</span>";
                    }else{
                             return " <span class=\"smmtitle-latinname\">".$cpt_tmp_title[0]." </span><span class=\"smmtitle-commonname\">".$cpt_tmp_title[1]." </span><span class=\"smmtitle-familyname\">".$cpt_tmp_title[2]."</span>";
                    }
            }
    }

    Ideally, I could assign a different class to the post navigation titles vs. the post title.

    Thread Starter mgargiullo

    (@mgargiullo)

    Thread Starter mgargiullo

    (@mgargiullo)

    Ok… think I’m on the right track. Spacing is a little off, but working on it.

    Full style:

    #toggle-nav::before {
        background: #252525 none repeat scroll 0% 0%;
        color: #FFF;
        content: "TOC";
        display: block;
        padding: 7.425px;
        position: fixed;
        top: 50%;
        transition: all 0.5s ease-in-out 0s;
        left: 0px;
    
    -webkit-transform: rotate(-90deg);
      -moz-transform: rotate(-90deg);
      -ms-transform: rotate(-90deg);
      -o-transform: rotate(-90deg);
      transform: rotate(-90deg);
    
      /* also accepts left, right, top, bottom coordinates; not required, but a good idea for styling */
      -webkit-transform-origin: 50% 50%;
      -moz-transform-origin: 50% 50%;
      -ms-transform-origin: 50% 50%;
      -o-transform-origin: 50% 50%;
      transform-origin: 50% 50%;
    
      /* Should be unset in IE9+ I think. */
      filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
    
    }

    Forum: Hacks
    In reply to: google map in admin section
    Thread Starter mgargiullo

    (@mgargiullo)

    ok… disregard… I forgot that I have to set the height of the div so the map will show.

    Adding this allows it to show.

    <style>
    #map-canvas{
    width: 500px;
    height: 400px;
    }
    </style>

    Forum: Hacks
    In reply to: google map in admin section
    Thread Starter mgargiullo

    (@mgargiullo)

    “simple question…don’t hate me for this, but is your javascript up to date?”

    Honestly, not sure what you mean. The google api javascript is from google’s v3 sample code site. If I put it on its own, it loads fine and displays the map. Like above, the map code is loaded into the DIV, but not displayed.

    Forum: Hacks
    In reply to: google map in admin section
    Thread Starter mgargiullo

    (@mgargiullo)

    Also have this:

    add_action( 'admin_enqueue_scripts', 'mrg_test_head' );

    and this:

    function mrg_test_head() {
    	?>
    	<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
    	<?php
    	wp_register_script('mrg_test_google_js_api', "https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false");
    	//wp_register_script('mrg_test_functions', mrg_test_PLUGIN_DIR . '/functions.js');
    	wp_enqueue_script('mrg_test_google_js_api');
    	wp_enqueue_script('mrg_test_functions',plugins_url('/functions.js', __FILE__));
    }

    So the google API is loaded.

    Forum: Hacks
    In reply to: google map in admin section
    Thread Starter mgargiullo

    (@mgargiullo)

    No… Not Bing maps.

    So here’s the code on the admin page:

    function mrg_test_Add_Page() {
    	if ( !current_user_can( 'manage_options' ) )  {
    		wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
    	}
    	?>
    
    	<script type="text/javascript">
    	jQuery.noConflict();
    
    	jQuery(document).ready(function($) {
    		mrgtestInitialize();
    	});
    
    	var map;
    	var geocoder;
    	var position;
    
    	function mrgtestInitialize() {
    			//geocoder = new google.maps.Geocoder();
    			var latlng = new google.maps.LatLng(40.7142, 74.0064);
    			var mapOptions = {
    		    	zoom: 8,
    		    	center: latlng,
    		    	mapTypeId: google.maps.MapTypeId.ROADMAP
    		  	};
    			map = new google.maps.Map(document.getElementById("map-canvas-1"), mapOptions);
    	}
    	</script>
    
    	<div id="map-canvas-1"> </div>
    
    	<?php
    }
Viewing 8 replies - 1 through 8 (of 8 total)