Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter forrestuv

    (@forrestuv)

    It just adds a small image near the title..

    add_filter('the_title', 'newTitle', 10, 2);
    function newTitle($title, $id) {
    	$catImgs="";
        if(get_post_type($id)=='post' && are_we_in("the_title"))
    	{
    		if ( !is_admin() && in_the_loop() )
    		{
    			$catImgs=getTitleImages($id);
    		}
    	}
    	else
    		if(get_post_type($id)=='page')
    		{
    		}
    	return $catImgs.$title;
    }
    Thread Starter forrestuv

    (@forrestuv)

    I think that the right solution is to modify your code as follows

    ...
    'title'	=> apply_filters( 'the_title', $pp->post_title, get_the_ID() ),
    ...
    ...
    <?php echo apply_filters( 'the_title', $p->post_title, get_the_ID() ); ?>
    ...

    it seems to work but I haven’t so much experience with WP …
    can you confirm it?

    Thread Starter forrestuv

    (@forrestuv)

    The error is on my functions.php where I override the_title.
    Missing argument 2 for newTitle() in /home/wp/wp-content/themes/headline-news-child/functions.php on line 21
    That leads to: Basic Google Maps Placemarks error: bgmpData undefined.

    for some reason I cannot override the_title anymore..

    add_filter('the_title', 'newTitle', 10, 2);
    function newTitle($title, $id) <<<line 21
    {
    	$catImgs="";
        if(get_post_type($id)=='post' && are_we_in("the_title"))
    	{
    		if ( !is_admin() && in_the_loop() )
    		{
    			$catImgs=getTitleImages($id);
    		}
    	}
    	return $catImgs.$title;
    }

    removing the apply_filter() in:
    core.php line 2527
    shortcode-bgmp-list-marker.php line 3
    my functions.php (inside child theme) works again..

    analyzing chrome debug console you can notice that the errors halts js execution..

    <div class=”entry-content”>
    <p>test</p>

    <script type=”text/javascript”>
    var bgmpData = {
    options: {“mapWidth”:”600″,”mapHeight”:”400″,”latitude”:”41.9027835″,”longitude”:”12.4963655″,”zoom”:”5″,”type”:”ROADMAP”,”typeControl”:”off”,”navigationControl”:”off”,”infoWindowMaxWidth”:”500″,”streetViewControl”:true,”viewOnMapScroll”:false,”clustering”:{“enabled”:”on”,”maxZoom”:”7″,”gridSize”:”1000″,”style”:”people”,”styles”:{“people”:[{“url”:”http:\/\/www.xxx.com\/wp\/wp-content\/plugins\/basic-google-maps-placemarks\/includes\/marker-clusterer\/images\/people35.png”,”height”:35,”width”:35,”anchor”:[16,0],”textColor”:”#ff00ff”,”textSize”:10},{“url”:”http:\/\/www.xxx.com\/wp\/wp-content\/plugins\/basic-google-maps-placemarks\/includes\/marker-clusterer\/images\/people45.png”,”height”:45,”width”:45,”anchor”:[24,0],”textColor”:”#ff0000″,”textSize”:11},{“url”:”http:\/\/www.xxx.com\/wp\/wp-content\/plugins\/basic-google-maps-placemarks\/includes\/marker-clusterer\/images\/people55.png”,”height”:55,”width”:55,”anchor”:[32,0],”textColor”:”#ffffff”,”textSize”:12}],”conversation”:[{“url”:”http:\/\/www.xxx.com\/wp\/wp-content\/plugins\/basic-google-maps-placemarks\/includes\/marker-clusterer\/images\/conv30.png”,”height”:27,”width”:30,”anchor”:[3,0],”textColor”:”#ff00ff”,”textSize”:10},{“url”:”http:\/\/www.xxx.com\/wp\/wp-content\/plugins\/basic-google-maps-placemarks\/includes\/marker-clusterer\/images\/conv40.png”,”height”:36,”width”:40,”anchor”:[6,0],”textColor”:”#ff0000″,”textSize”:11},{“url”:”http:\/\/www.xxx.com\/wp\/wp-content\/plugins\/basic-google-maps-placemarks\/includes\/marker-clusterer\/images\/conv50.png”,”height”:50,”width”:45,”anchor”:[8,0],”textSize”:12}],”hearts”:[{“url”:”http:\/\/www.xxx.com\/wp\/wp-content\/plugins\/basic-google-maps-placemarks\/includes\/marker-clusterer\/images\/heart30.png”,”height”:26,”width”:30,”anchor”:[4,0],”textColor”:”#ff00ff”,”textSize”:10},{“url”:”http:\/\/www.xxx.com\/wp\/wp-content\/plugins\/basic-google-maps-placemarks\/includes\/marker-clusterer\/images\/heart40.png”,”height”:35,”width”:40,”anchor”:[8,0],”textColor”:”#ff0000″,”textSize”:11},{“url”:”http:\/\/www.xxx.com\/wp\/wp-content\/plugins\/basic-google-maps-placemarks\/includes\/marker-clusterer\/images\/heart50.png”,”height”:50,”width”:44,”anchor”:[12,0],”textSize”:12}]}}},
    markers:
    <b>Warning</b>: Missing argument 2 for newTitle() in <b>/web/htdocs/www.xxx.com/home/wp/wp-content/themes/headline-news-child/functions.php</b> on line <b>21</b>

    <b>Warning</b>: Missing argument 2 for newTitle() in <b>/web/htdocs/www.xxx.com/home/wp/wp-content/themes/headline-news-child/functions.php</b> on line <b>21</b>
    [{“id”:3234,”title”:””,”latitude”:”38.1156879″,”longitude”:”13.3612671″,”details”:””,”categories”:[],”icon”:”http:\/\/www.xxx.com\/wp\/wp-content\/uploads\/2015\/03\/qTag2.gif”,”zIndex”:”0″},{“id”:3221,”title”:””,”latitude”:”38.1156879″,”longitude”:”13.3612671″,”details”:”<p>Descr<\/p>\n”,”categories”:[],”icon”:”http:\/\/www.xxx.com\/wp\/wp-content\/uploads\/2015\/03\/c.gif”,”zIndex”:”0″}] };
    </script>

    <div id=”bgmp_map-canvas”>
    <p>Loading map…</p>

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