Replies: 0
Hi All,
I have created a custom shortcode “Answer” with following coding, which is working fine.
function show_me_answer($atts){
extract(shortcode_atts(array(
"title" => 'उत्तर देखने के लिए क्लिक करें : Click here to see answer',
), $atts));
$return_string = '<div class="ap-answer"><a href="'.get_permalink().'/2">'.$title.'</a></div>';
return $return_string;
}
This shortcode will navigate user to nest subpage (url/2) where answer of the post is hidden. I have almost no knowledge of coding so wanted to check whith you all how can I add two more criteria inside this shortcode so that this shortcode will navigate user to next page only if following two criteria are met
1. Category of the current post is “puzzles”
2. There actually a subpage exists, if there is no url/2 it should not be displayed.
You can check the current working short code on my website amexing.com
Thanks,