Title: Function called twice on single-.php
Last modified: August 21, 2016

---

# Function called twice on single-.php

 *  [linkinp](https://wordpress.org/support/users/linkinp/)
 * (@linkinp)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/function-called-twice-on-single-php/)
 * Hello,
 * 1. I have created a custom post type and corresponding custom single page.
    2.
   So single-music.php is a copy of single.php 3. I have a hyper-link on single-
   music.php called I AGREE. The link points to the same permalink of the post music
   with the ?action=agree appended in the end. 4. The idea is when the user clicks
   the link, I will circle back to the same post but before doing that I will simple
   update some data on a table. So the first lines in single-music.php are if($_GET[‘
   action’] == ‘agree’){ update table by incrementing a counter against user).
 * 5. All this works fine, just that the table gets incremented 2 times, as if the
   user has agreed to 2 items instead of one.
 * 6. Point to Note:
    - This issue is not local to FireFox, but observed in Safari also.
    -  My permalink is set to Post name ( if that matters )
 * 7. I have tried other solutions like
    remove_action( ‘wp_head’, ‘adjacent_posts_rel_link_wp_head’,
   10, 0 ); but that does not work either. May be I am not removing the action properly.
 * 8. Any suggestions will help me.

The topic ‘Function called twice on single-.php’ is closed to new replies.

## Tags

 * [function.php](https://wordpress.org/support/topic-tag/function-php/)
 * [permalink](https://wordpress.org/support/topic-tag/permalink/)

 * 0 replies
 * 1 participant
 * Last reply from: [linkinp](https://wordpress.org/support/users/linkinp/)
 * Last activity: [12 years, 2 months ago](https://wordpress.org/support/topic/function-called-twice-on-single-php/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
