Add related Keyword Google Custom Search (CSE) - drupal

I use Drupal 7 with MetaTags Module. But this is not a Drupal specific problem.
This Website use the CSE (Google Custom Search) to find content.
Now, i want to add to each content related keyword.
When I create a content about italy, so the related keyword are e.g. "pizza, pasta, fiat ..."
Now I think the "< meta keyword />" would be the solution. But this dont work.
If I add the keywords in the "< meta description />", after reindexing i find the "italy" content when i search "pizza". But the "< meta-tag description />" is reserved for google result
Is there not a simple solution with "" tag?
Best regards

I've found a solution.
I add synonyms for Search Results
https://support.google.com/customsearch/answer/2631030?hl=en

Related

woocommerce display tag description on product page

I looked around for a while today for a way to display a tag description on the product page. But could not find a close answer to my issue of displaying a tag description.
I know if you have more than one tag on a page and it pulls in all tag descriptions would not be good for SEO or page look but I believe we are only pulling in one tag that contains a description, the rest are generic tags without a description.
Where should I be looking at how this can be done? I'm sure this is a common woocommerce mod and I'm not using the correct woocommerce terminology. Here is the info currently being displayed on our product page.
----current----
Tag - Rose Quartz
----desired-----
Tag - Rose Quartz
This beautiful pink stone is well-known for the loving powers that it
gives off. This is the stone of love, but more crystal experts see it
as self-love, self-esteem, and acceptance of one’s true self. Rose
quartz also helps to ward off any resentment that the wearer has in
their lives that have built up over time. This stone brings strength to
the heart.
So I figured out how this can be done and would like to share my findings. You will need to first have a way to add snippets to your page. I used a plugin called XYZ PHP Code, this plugin allows me to create PHP snippets to be used in elementor page builder.
I created a new snippet in XYZ named "tagdesc" and used the following code to display tag descriptions.
<?php
$posttags = get_the_terms( get_the_ID(), 'product_tag' );
if ($posttags) {
foreach($posttags as $product_tag) {
echo $product_tag->name;
echo $product_tag->description;
}
}
?>
Save and use your snippet in my case it was called [xyz-ips snippet="tagdesc"].
This will display all the tag names and descriptions of that product. In my case I removed (echo $product_tag->name;) as I did not need to show the tag name. This works in our case as only one tag has a description, I feel a better solution would be pulling out a description from a single product attribute using a similar method but have not found a solution that works.

How to add a meta keyword tag in each page of my drupal application?

I want to add a meta keyword tag which have to come with every pages within my drupal website. How to do that ?
It's too easy just use the meta tag module .
And for drupal6 i found this: Meta tags Node Type
Welcome
It might need a bit of tweaking but I built a module that does this.
https://github.com/SpaceBeers/Drupal-7-Meta-Tags-Module
It also lets you set a site wide default title and description which can be overridden for each node. You can select which content types this appears on.
It'd be nice to get some feed back on it.
Just add The code given below at the top of your template.php file (Custom).
drupal_set_html_head('<meta name="keywords" content="CustomKeyword" />');
Done.

Wordpress feed and post titles duplicating

I just checked the feed title and some of the post titles also and is very much confused. The title is duplicating itself like: Site Title | Site Title. Here is the link of the feed:
http://www.dharamshalatravels.com/feed
Please let me know any solutions for this. I have checked the core files and there is no problems in those files.
Thanks in Advance
I usually replace the core feeds:
http://codex.wordpress.org/Customizing_Feeds
I'll usually make a custom template and assign it to a page.
In the custom template I'll build my own RSS.
The title is made by: <title><?php bloginfo_rss('name'); wp_title_rss(); ?></title>
both these functions can be filtered.
with add_filter('wp_title_rss','');
and add_filter('bloginfo_rss','');
Some template or plugin is probably screwing this up.
add you own filters to find out which of the two (if not both?) is messing it up and apply your own filter.

How can I find feed or XML of a particular news source

I want to get xml file of a particular news source, Of if there is any project which converts html news to xml, parsing page and tokenizing its various traits such as date, author name, title, content etc. in a single xml or similar type of file.
For example see this link:
http://daily.bhaskar.com/article/NAT-TOP-yeddyurappa-breaks-venkaiah-naidus-laptop-slaps-minister-reports-2318460.html
How can I extract content, author, date etc from this webpage. Or if I can find this webpage's feed I can do that easily. But How can I search for that.
which technology are you using ?
If it's a purely client-side / web solution then you'll find js options in a previous StackOverflow question. If you're on the server-side you can use WebClient/LINQ to hit the ATOM feed and parse it
To find out if a page has a feed scan the HTML for a specific <link> tag with these rel and type attributes:
<link rel="alternate" type="application/rss+xml" title="Page as RSS"
href="http://example.com/page/feed">
The feed URL is stored in the href attribute. This mechanism is called RSS Autodiscovery

Related posts from the blogosphere - dynamic integration of Google Blogsearch RSS on wordpress category pages

I'm looking for a method to put the three latest "news" from Google Blogsearch/Twitter search feeds into the bottom of category Pages. Maybe like this (assuming we're on the archive page for the "Sports" category):
What others say about "Sport":
Instapundit - Michael Jordan Comeback!
Huffington post - Michael Jordan Comeback!
Crazyguy - Michael Jordan Comeback!
So we all know that you can put
<?php include_once(ABSPATH.WPINC.'/rss.php');
wp_rss('pathtofeed.com', 3); ?>
in a template-file and it will list the latest three items of a feed.
I would like to put the path to the feed of a query to Google Blogsearch, e.g. [http://blogsearch.google.com/blogsearch_feeds?hl=en&q=sport&ie=utf-8&num=10&output=rss][1]
Works fine. But I would like to replace the sport query with the template tag for the category title - so it dynamically queries Google for a RSS-feed of sport searches. I've tried this:
<?php
include_once(ABSPATH.WPINC.'/rss.php');
wp_rss('www.blogsearch.google.com/blogsearch_feeds?hl=en&q=<?php single_cat_title() ?>&ie=utf-8&num=10&output=rss', 3);
?>
(omitted 'http' cause I can't post hyperlinks here as a new user).
But all I get is:
There was a problem with the feed, try again later.
(translated from Danish error message).
Is it the syntax?
You've got a couple of issues in that code.
The first is you have a <?php inside an already opened <?php section. Concatenation is the answer to that problem.
The second is the function single_cat_title() displays the category title by default. Meaning it "echo()"s it out. So you need to tell that function to return the value not display it.
My solution would be to add a line of code above your include there to get the category you're looking for along the lines of:
$current_category = single_cat_title("", false);
The "false" tells the function to return it as a value instead of displaying it by default, the first parameter is the prefix or the text to display before the category title.
Then concatenate the current_category variable into your include statement
You can check out that function on the Template Tags page in the Wordpress Codex.

Resources