May 4, 2011

Add feed name or post tags to post via php? | CyberSEO Pro | Support Forum

Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_TopicIcon
Add feed name or post tags to post via php?
Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 (0 votes) 
September 17, 2023
6:14 pm
Avatar
herb.mac
Member
Members
Forum Posts: 7
Member Since:
September 13, 2023
sp_UserOfflineSmall Offline

I am using your Login to see this link.

I would like to add the name of the site to the “Read more at”. I have the site name as both the feed title and the post tags. Is it possible to add either via php?

Thank you.

September 17, 2023
6:24 pm
Avatar
CyberSEO
Admin
Forum Posts: 3689
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

Just a simple question – you need it for a specific feed, right? In this case you can use the name of the feed/site instead of “Read the Product Page…”

Login to see the code

September 17, 2023
11:05 pm
Avatar
herb.mac
Member
Members
Forum Posts: 7
Member Since:
September 13, 2023
sp_UserOfflineSmall Offline

Yes, I could do that. That’d be the simple solution. I have a lot of feeds and I was hoping to automate the process with a template.

September 17, 2023
11:10 pm
Avatar
CyberSEO
Admin
Forum Posts: 3689
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

Do you want a shortcode for post templates that contains the name of the current feed?

September 17, 2023
11:16 pm
Avatar
herb.mac
Member
Members
Forum Posts: 7
Member Since:
September 13, 2023
sp_UserOfflineSmall Offline

That would be fantastic! 

September 17, 2023
11:20 pm
Avatar
herb.mac
Member
Members
Forum Posts: 7
Member Since:
September 13, 2023
sp_UserOfflineSmall Offline

I put the feed source name in the post tags as well as the feed title. I don’t know if that would easier to pull it from since you are using the post_ info in the php already…?

September 17, 2023
11:24 pm
Avatar
CyberSEO
Admin
Forum Posts: 3689
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

Coma-delimited post tags are available via the %post_tags% shortcode. When imported from a feed, they are the same as %categories% because RSS feeds do not have WordPress-specific tags. They only have categories.

Login to see this link

September 17, 2023
11:27 pm
Avatar
herb.mac
Member
Members
Forum Posts: 7
Member Since:
September 13, 2023
sp_UserOfflineSmall Offline

Gotcha. So, I could make each feed a category and then use the %post-tags% to accomplish what I’m after?

September 17, 2023
11:34 pm
Avatar
CyberSEO
Admin
Forum Posts: 3689
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

Yes, you can, but it is better to use the %categories% shortcode. It’s more correct. Via PHP the post categories are available as an array. For example, if you need the 1st category from that array the variable name will be

Login to see the code

September 18, 2023
12:29 am
Avatar
herb.mac
Member
Members
Forum Posts: 7
Member Since:
September 13, 2023
sp_UserOfflineSmall Offline
10sp_Permalink sp_Print
0

Thank you. I will give it a shot.

September 19, 2023
2:05 am
Avatar
herb.mac
Member
Members
Forum Posts: 7
Member Since:
September 13, 2023
sp_UserOfflineSmall Offline
11sp_Permalink sp_Print
0

Problem 1:

I’m getting inconsistent results with the limit and read more code. On certain sites, it will not post “Read the rest at” link at all. I assume that has something to do with the source site? Espn.com and ForeignPolicy.com won’t give me links.

Problem 2:

Earlier I has having issues with the link not being consistent on three posts from the same site. I hard coded: “Read the rest at Example”

Post 1 : “Read more”

Post 2: “Read more at Example”

Post 3: blank

I deleted all the posts and trash. Reloaded them and that issue seems fixed. 

September 19, 2023
2:14 am
Avatar
CyberSEO
Admin
Forum Posts: 3689
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline
12sp_Permalink sp_Print
0

The plugin has about 200 options and each of them can seriously affect the generated posts. So a mix of these options will produce countless different results. But when we talk about custom PHP snippets, it’s really impossible to even imagine what exactly will be generated. I need to see all your settings to answer your question. Please export your feed to a file and attach it to Login to see this link.

Forum Timezone: Europe/Amsterdam

Most Users Ever Online: 541

Currently Online:
12 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

ninja321: 84

s.baryshev.aoasp: 64

Freedom: 61

MediFormatica: 49

B8europe: 47

saviulisse67: 45

Member Stats:

Guest Posters: 338

Members: 2656

Moderators: 0

Admins: 1

Forum Stats:

Groups: 1

Forums: 5

Topics: 1541

Posts: 7781

Newest Members:

SKMIT, kellyslrm, pu.analytics.ee, frajaros, federico_pac, rexfordkent

Administrators: CyberSEO: 3689