Not able to get the exact URL of the file on server located in active wordpress theme

You can’t put a php var, for example $url, in a string in this manner: file_get_contents( “http://example.com/wp-content/themes/themename/download/$url/count.txt” ); You can use get_template_directory_uri to return the url to the current theme directory. For example: $url = get_template_directory_uri() . ‘/download/count.txt’; echo file_get_contents( $url );

add shortcode heading showing multiple time

Add a wrapper to your plugin output if ( $rposts->have_posts() ) { $html=”<div class=”pl_recent_posts”>”; $html .= ‘<h3>Recent Posts</h3><ul class=”recent-posts”>’; while( $rposts->have_posts() ) { $rposts->the_post(); $html .= sprintf( ‘<li><a href=”https://wordpress.stackexchange.com/questions/202834/%s” title=”https://wordpress.stackexchange.com/questions/202834/%s”>%s</a></li>’, get_permalink($rposts->post->ID), get_the_title(), get_the_title() ); } $html .= ‘</ul>’; $html .= ‘</div>’; } Create a custom CSS file .pl_recent_posts:not(:first-of-type) h3 { display: none; } And enqueue … Read more

Run PHP Results inside WP Shortcode

If I understand correctly, you have a shortcode called wp_charts that accepts a pramaeter datasets, and you want to create a new shortcode that runs a database query and embeds the results of the query as the value of datasets? If so, there are several ways to do this, but I think the easiest – … Read more

Give permission to admin to see user’s page

Instead of using $user_id = get_current_user_id(), you want to get the ID of the author by doing something like $author = get_user_by( ‘slug’, get_query_var( ‘author_name’ ) ); or if ( $author= get_query_var( ‘author’ ) ) { $author = get_user_by( ‘id’, $author_id ); } And then use like $user_id = $author->ID; Source: https://wordpress.stackexchange.com/a/35251/47406

Where is this admin page loaded from?

The functionality (specifically the code) you are trying to track down will exist in /wp-content/plugins/{EventEspresso3Folder}/ and likely will NOT be named dt_intfc5228c10e15432. It’s going to be a dynamically generated page likely created using add_menu_page() or add_submenu_page() some where in the source code of that plugin. I haven’t used that plugin before so I can’t provide … Read more