Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 700125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:27:45+00:00 2026-05-14T03:27:45+00:00

I have added a function to functions.php on my theme. function insertAds($content) { $content

  • 0

I have added a function to functions.php on my theme.

function insertAds($content) {

$content = $content.' add goes here';

return $content;}

add_filter('the_content_feed', 'insertAds');

add_filter('the_excerpt_rss', 'insertAds');

The problem is that I’m having the add displayed under each content, and not at the end of the rss page. How can I fix that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T03:27:45+00:00Added an answer on May 14, 2026 at 3:27 am

    WordPress doesn’t offer a hook for what you want to do. In which element would you place the ad?

    The usual RSS-2-Feed has meta data and items (the content). There is no other element.
    See wp-includes/feed-rss2.php for details.

    Update

    Adjust the following code to your needs and put the file into your plugin directory:

    <?php
    /*
    Plugin Name: Last man adding
    Description: Adds content to the last entry of your feed.
    Version: 0.1
    Author: Thomas Scholz
    Author URI: http://toscho.de
    Created: 31.03.2010
    */
    
    if ( ! function_exists('ad_feed_content') )
    {
        function ad_feed_content($content)
        {
            static $counter = 1;
            // We only need to check this once.
            static $max = FALSE;
    
            if ( ! $max )
            {
                $max = get_option('posts_per_rss');
            }
    
            if ( $counter < $max )
            {
                $counter++;
                return $content;
            }
            return $content . <<<MY_ADDITIONAL_CONTENT
    <hr />
    <p>Place your ad here. Make sure, your feed is still
    <a href="http://beta.feedvalidator.org/">validating</a></p>
    MY_ADDITIONAL_CONTENT;
        }
    }
    add_filter('the_content_feed', 'ad_feed_content');
    add_filter('the_excerpt_rss',  'ad_feed_content');
    

    Is this the effect you had in mind? As you can see, adding content is rather easy. 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 505k
  • Answers 505k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If your grid is single-selection, my suggestion is that you… May 16, 2026 at 3:26 pm
  • Editorial Team
    Editorial Team added an answer switch ($i) { case A: case B: case C: $letter… May 16, 2026 at 3:26 pm
  • Editorial Team
    Editorial Team added an answer Press Ctrl+. to open that menu. May 16, 2026 at 3:26 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

In PHP 5.2 there was a nice security function added called input_filter, so instead
I am trying to make a function in PHP that will allow me to
<?php class A{ //many properties protected $myProperty1; protected $myProperty2; protected $myProperty3; public function __construct(){
I get dynamic content with Ajax and i put it in a div, but
Trying to hook into the function comment_text() supplied by Wordpress API to wrap the
I'm talking about C and/or C++ here as this are the only languages I
I found this article: http://www.deluxeblogtips.com/2010/05/editor-style-wordpress-30.html I created a child theme using the Twentyten theme
I am trying to create a user login/creation script in PHP and would like
Hi I am trying to store names into an Oracle database and fetch them
I've done a lot of searching on this, so please forgive me if I've

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.