Wordpress - How to create dynamic affiliate link that includes page title - wordpress

What's up team,
What I'm trying to achieve in wordpress is add a dynamic affiliate link that includes the page title which leads to an external website's search page.
For example.
The post page or page is called www.website.com/blog/red-ball or www.website.com/red-ball
And I want to add a link to an affiliate's search page using the page's title. So I need the dynamic url to look like this www.affiliate.com/search?=red-ball
Now I dont have a problem doing this manually. But if I have 5 different affiliates and 1000 products, i really dont want to be going to each page and doing this one by one. What im looking for is to add a button preferably thru a shortcode that will add a button to the page for a specific affiliate with his url and the button automatically appends the page title to it.
This way I can add 5, 6, 7 or how many other affiliate partners I want and the button will lead to the partners affiliate search page automatically querying my page keywords.
Anyone have an solution or idea on how to do this?
Thank you,
Red

Related

Is there a way to create a custom report to track page views for certain URLs in Google Analytics?

I'm trying to create a custom report where I can track page views for certain URLs on my website, but struggle to include more than 1 URL. Any suggestion is greatly appreciated.
This is easily doable with a custom report and segments in GA:
You can do the following:
Click on Customization
Click on Custom Reports
Choose Landing Page and any metrics you need
Click Save
Once you've done this, you can set up a segment with conditions:
You can add the names of whichever landing pages you need inside the condition text box.

Insert a full woocommerce product page into another page

No, I just couldn't find this anywhere else. (everything but)
Does anyone know how to (without using an iFrame) insert a full woocommerce single product page within another page (so it appears in it's entirety).
What I'm looking for is a way to create a new page, type some content (for example, a headline) implement some code (shortcode etc) and have the full woocommerce simple product page of my choice appear in its entirety at that point, allowing me to continue to add content thereafter.

Permalink Goes to Old Page

I have been working on a site created by another developer. I have been fixing the site to make it more visually appealing. I am also responsible for adding new events and pictures which i self taught myself to do.
I have a situation where I have a page with the following permalink:
http://www.cic-nj.org/events/
The problem is that this link goes to a page that does not show the edits that i am making under that page and there is no other page listed that shows the info it actually displays.
this is what I have in the editor box on wordpress that I want it to show.
enter image description here
this is what appears when url is used or when i click view
enter image description here
I have been sure to click update and renewing page to view it. it's like its going to a ghost page i can not edit.
Can anyone point me in the right direction on this?
Thanks in advance...
You are experiencing "slug collision": more than one thing in your WP install has the same slug.
The problem that you have is events is a custom post type, with a slug set to events - therefore the url http://www.cic-nj.org/events/ is directing to the listing of events. This is an automatic feature of WordPress. (Note - you can see more details to support this conclusion by the fact that you've got individual events accessible at url's such as http://www.cic-nj.org/events/blue-apron-info-session/ )
Note that custom post type slugs will always take priority over a page / post slug.
You have a couple of options:
If you want a page to display the content that you've created, the page's slug / permalink must be different than events
If it's acceptable, you can rename the slug of the "events" custom post type to something different. This has the potential consequence of losing SEO "juice".
If it's acceptable, you can remove the custom post type, if you aren't going to use them any longer.
NOTE: It may be tempting to ask "how do I remove the custom post type", or "how do I change the post type slug". Those are different questions, and if you need to ask, they should be asked in a different question - not added as a comment below.

wordpress blogs in different pages

I have a page containing a set of images linked to other pages. How can I make each of the linked pages a separate blog?
To give you some more context, each image represents a challenge that I set myself up to and I would like to have a separate 'blog' for each challenge to document my progress. So far I have managed to link pages together and navigate from the page containing all the challenges to the page containing the details about 1 single challenge. However the latter page is not a blog so I cannot add new posts to the page. If I try to write a new blog post it gets added above the challenges(list) page
This is a link to the page that I am refering to.
Thanks in advance for your help
What you need to do is use categories for your posts - like Challenge One and Challenge Two - and then your posts will be automatically organized into category archives. Add a third category - called All Challenges - to all the posts and that category archive will list all posts in all three categories by chronology.
The URLs to the category archive pages will be something like this, depending on your category names and slugs, and how you set up your category base in Settings>>Permalinks.
example.com/categories/challenge-one
example.com/categories/challenge-two
example.com/categories/all-challenges
Link those category archive URLs from your images on your main page that has a gallery of images for each challenge post category.
You can make up custom category templates for each category, so the layout and design can be different.
See
https://codex.wordpress.org/Using_Permalinks#Category_base_and_Tag_base
and
https://make.wordpress.org/training/handbook/user-lessons/categories-vs-tags/
and
https://codex.wordpress.org/Category_Templates
There are multiple ways you can achieve this in WordPress. Let me tell you the easiest one:-
Using Post Categories
Follow the steps below:
Step1: Break your challenges into different categories, for example Challenge 1, Challenge 2, and so on... You can easily do that by creating and choosing the right category while writing a post.
Step2: Go Settings->Premalinks in your WordPress dashboard and choose "Post Name".
Step3: Now you have to find the new links for your challenge images. You can find these links in Post->Categories tab within your dashboard. Once you are in the categories browse page within your WordPress dashboard, just hover over the category whose link you want and you will see a "View" tab which will take you to that particular category page. This category page will show only the posts that you have published under that particular category.
Step4: Once you have the category link with you just update it in the respective challenge image link.
I hope you will be able to resolve your issue with this.

how can I best display a list of affiliate links in Drupal?

I have a Drupal 5 website on which I want to display a list (or grid) of affiliate links to different products, sales and offers. Each 'affiliate product' node will have a title, description, an image and a URL. When either the image or URL link is clicked, the user should be redirected to the URL.
I've gotten close to this, using a view, custom pager and adding a custom image field to my node in CCK (Content Construction Kit), but whenever the image is clicked, it goes to the full node page rather than the URL.
Any advice from people who've done this or something similar would be greatly appreciated. If this can be more easily achieved in Drupal 6, I'm prepared to upgrade the site, as that was on the to-do list anyway.
Thanks in advance.
If you want to stick with Drupal 5 you can use a View template in your theme (using the Theme Wizard module as a starting point) to explicitly create an image link to the URL link. That would easily be the quickest solution.
If you upgrade to Drupal 6 you can use the new features in Views 2 to re-write the image field output to include the link. There are a lot of differences between Views and Imagefield between Drupal 5 and 6 though so be ready for a slight learning curve if you go that route.

Resources