ggg377
Forum Replies Created
-
Forum: Plugins
In reply to: [Yoast SEO] Use custom function for post title template?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 :'(
Forum: Fixing WordPress
In reply to: Getting is_single to work in functions.phpThanks keesiemeijer, that helped ??
Forum: Fixing WordPress
In reply to: Fixing site keywordsI’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.
Forum: Plugins
In reply to: [Yoast SEO] Not showing a category in posts title tag?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
Forum: Plugins
In reply to: [Yoast SEO] XML Sitemaps cannot be found??Found a solution for myself. Disabled the sitemap functionality and re-enabled it. Works now.
Forum: Plugins
In reply to: [Yoast SEO] XML Sitemaps cannot be found??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.
Forum: Fixing WordPress
In reply to: Php if within if problem (is_home function)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 ??
Forum: Fixing WordPress
In reply to: Php if within if problem (is_home function)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.
Forum: Fixing WordPress
In reply to: Php if within if problem (is_home function)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.
Forum: Fixing WordPress
In reply to: Cant access my dashboardCan you give any details? Are you getting error messages? What happens when you try to access your dashboard?
Forum: Fixing WordPress
In reply to: Hiding H1 title for a logoThanks 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.
Forum: Fixing WordPress
In reply to: Hiding H1 title for a logoOh, 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.
Forum: Fixing WordPress
In reply to: Hiding H1 title for a logoIn 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.
Forum: Fixing WordPress
In reply to: Hiding H1 title for a logoAndrew: 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.
Forum: Fixing WordPress
In reply to: Creative/efficient ways to add H1 tag to index?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.