Skip to content
WJunction - Webmaster Forum

How to use "if" in this code?

Status
Not open for further replies.

Divvy

Experienced Member
806
2009
18
Hello guys,


Maybe someone can help me.


I'm using tradeexpert script in my wordpress blog.
To use skimming traffic, I changed the following code in my homepage:


From:
PHP:
<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">


To:
PHP:
<a href="/webmasters/out.php?s=100,75,65&u=<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">


Now I have installed this plugin:
https://wordpress.org/plugins/page-links-to/


Screenshot of the plugin:
screenshot-1.png



My idea is to use always this code in my posts:
PHP:
<a href="/webmasters/out.php?s=100,75,65&u=<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">


But when I use a custom URL I want to use the default code:
PHP:
<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">


Would be great if someone can help me with this :)


Plugin code:
https://paste2.org/4Fa60fpe


Thank you guys and a happy weekend to all!
 

3 comments

use this

before line 229 add these lines

PHP:
// MrQaidi start 
if($_POST['cws_links_to_choice'] =='custom'){
    $_POST['cws_links_to'] = '/webmasters/out.php?s=100,75,65&u='. $_POST['cws_links_to']; 
  }
 // MrQaidi end

as you see php code to check if choice is custom then add /webmasters/out.php?s=100,75,65&u= before url.

i hope this is was you asking
 
Status
Not open for further replies.

About the author

D
Experienced Member · Joined
806
Messages
18
Reactions
18
Points
Grow your business

Advertise on WJunction

Connect with an established international community of webmasters, hosting providers, developers and online entrepreneurs.

  • Premium & Premium+ Sticky
  • Dedicated section banners
  • Site-wide banner advertising
Explore advertising options
Back
Top Bottom