Forum Replies Created

Viewing 15 replies - 1 through 15 (of 65 total)
  • Thread Starter ggg377

    (@ggg377)

    I figured I should get into wordpress-seo/inc/wpseo-functions.php and modify either of those lines: 1) ‘%%category%%’ => wpseo_get_terms( $r->ID, ‘category’ ), 2)

    function wpseo_get_terms( $id, $taxonomy, $return_single = false ) {
    	// If we're on a specific tag, category or taxonomy page, return that and bail.
    	if ( is_category() || is_tag() || is_tax() ) {
    		global $wp_query;
    		$term = $wp_query->get_queried_object();
    		return $term->name;
    	}
    
    	if ( empty( $id ) || empty( $taxonomy ) )
    		return '';
    
    	$output = '';
    	$terms  = get_the_terms( $id, $taxonomy );
    	if ( $terms ) {
    		foreach ( $terms as $term ) {
    			if ( $return_single )
    				return $term->name;
    			$output .= $term->name . ', ';
    		}
    		return rtrim( trim( $output ), ',' );
    	}
    	return '';
    }

    Basically I’m thinking of modifying the code to allow the insertion of my custom php function somewhere in there.

    Lets say the code is something like this:

    <?php
    foreach((get_the_category()) as $category) {
        if ($category->cat_name != 'hot') {
        echo '' . $category->name. '';
    }
    }
    ?>

    Where would I insert this? Please help :'(

    Thread Starter ggg377

    (@ggg377)

    Thanks keesiemeijer, that helped ??

    Thread Starter ggg377

    (@ggg377)

    I’m still stuck with this. I checked the source code of sites like Youtube and didn’t find any special code for generic terms. Am I making a big deal out of nothing or are there any precautions I should use? Seeing terms like “ago” and “views” listed as your top keywords doesn’t seem too encouraging.

    Thread Starter ggg377

    (@ggg377)

    Hi again. It’s unfortunate this thread hasn’t generated any interest. I’ve been working on a solution and here’s some thoughts on this issue:

    1) Would it be possible to set a custom title for single posts through the if is_single function and the required WordPress SEO title (<title><?php wp_title (”); ?></title>) for everything else through php else?

    2) I was able to pinpoint these lines in wpseo-functions.php:

    '%%category%%'     => wpseo_get_terms( $r->ID, 'category' ),
    function wpseo_get_terms( $id, $taxonomy, $return_single = false ) {
    	// If we're on a specific tag, category or taxonomy page, return that and bail.
    	if ( is_category() || is_tag() || is_tax() ) {
    		global $wp_query;
    		$term = $wp_query->get_queried_object();
    		return $term->name;
    	}

    Perhaps altering this could allow for excluding a single category?

    Thanks,

    ggg377

    Found a solution for myself. Disabled the sitemap functionality and re-enabled it. Works now.

    Same is happening to me. I think it started with one of the recent plugin updates (sitemaps were generating fine before). Not using a cache currently.

    Thread Starter ggg377

    (@ggg377)

    Ah I’m sorry Josh. It was my mistake. I forgot to put another part of a code I didn’t post about here within the tags so I was surprised when it showed up everywhere. I got it now.

    Thanks a lot for your time ??

    Thread Starter ggg377

    (@ggg377)

    It still doesn’t work. I’m pretty sure I’m not mixing something up. A previous similar is_home function I had in place of this worked.

    Thread Starter ggg377

    (@ggg377)

    Hey Josh, thanks for answering.

    For some reason the is_home functionality doesn’t work. The tptn_show_daily_pop_posts function shows up on all pages.

    Can you give any details? Are you getting error messages? What happens when you try to access your dashboard?

    Thread Starter ggg377

    (@ggg377)

    Thanks for that bit WPyogi. I got the code to work, thanks a lot Andrew.

    Considering the layout of the site, it would be really hard to squeeze an actual visible H1 title in there somewhere. I think I may have to go with hiding anyway, especially if it’s a popular practice used by industry leaders.

    I’ll definitely research the topic though and respond upon finding something interesting. Once again, thanks for the tip, WPyogi.

    I’ll mark the topic as resolved for now.

    Thread Starter ggg377

    (@ggg377)

    Oh, I actually noticed this is how its done on other sites as well. I thought moving content away from the screen, especially H1 titles is usually considered a spammy and forbidden technique, but I guess not. Thanks, I’ll try that and let you know how it goes.

    Thread Starter ggg377

    (@ggg377)

    In the case of the sites I mentioned as examples (Facebook, Yoast, etc), I’m pretty sure the actual H1 title doesn’t even get displayed (or at least it isn’t displayed in a noticable way). I would like to do something similar.

    Thread Starter ggg377

    (@ggg377)

    Andrew: I haven’t. Wouldn’t it simply shift the h1 text away from its original location (in this case moving black text on a black background), meaning users could still see it upon selection, their cursor would change when hovering over it etc? I could be wrong here.

    Thread Starter ggg377

    (@ggg377)

    I’m going to mark this topic as resolved and start a new topic on my other issue later. It’s going to be impossible for me to get this issue solved, because the title doesn’t match the actual problem I developed at all.

    Most of all, the original goal of this thread was reached. Thanks, dotnordic.

Viewing 15 replies - 1 through 15 (of 65 total)