New answers tagged

0

First follow what the codex says Shortcodes. Basically you just wrap your html in ob_start(); this will return the html as a string so you can echo it. 1st way : function my_shortcode() { ob_start(); ?> <HTML> <here> ... <?php return ob_get_clean(); } 2nd way function my_shortcode() { $output = ''; $output.= '<html>content</...


1

Yes, never trust user's input. Just because you told people to provide a valid number for a specific shortcode parameter, it doesn't guarantee that the input will always be a valid number, so always secure user's input — and output. You should also, if you haven't already done so, read these articles: Data Validation Securing Input Securing Output And ...


0

With this part: 'post__not_in' => array($custom_atts['hide']) you're actually running: 'post__not_in' => array( "7043,7128" ) with [customposts hide="7043,7128"]. Note that post__not_in expects an array of numbers, not an array with a single CSV element. Have a look at e.g. wp_parse_id_list() and don't forget to validate the input, to e.g. avoid ...


0

i know that but i want to add when on the first page that is maxed like 20 posts anyone can press like N.2 to go to the second page that will be olders posts like this


0

Your shortcode callback function is incorrect: add_shortcode('load_peoplesoft_result_page', 'load_peoplesoft_results()'); You've included the (), but only the function name should be passed: add_shortcode( 'load_peoplesoft_result_page', 'load_peoplesoft_results' ); Note that the second argument of add_shortcode() is a "callable". This is a standard PHP ...


0

I don't know about the shortcode above but in regular WordPress, you can control the number of posts on your blog page under Settings > Reading.


Top 50 recent answers are included