Dynamic content in pages
Dynamic content in pages
Dynamic content in pages
If you’re trying to do this just for anchor links within your current WP page, a table of contents style plugin will likely suffice; for example, see: http://wordpress.org/plugins/table-of-contents-plus/ This specific example auto-generates the table of contents and anchors based on the headers in your document/page, so it is fairly low fuss on you as the … Read more
Doesn’t seem like you are using an if-statement for showing the sub-pages? If you are not, I guess you can do it with jQuery. var sub = $(“div.subpages”); if (sub.length > 0) { $(“#secondary”).hide(); // replace “secondary” with the ID of the sidebar }
The database hasn’t been queried yet on init, there is no $post or $wp_query. See the Action Reference for the order actions are executed. Try moving your code to the template_redirect action.
I think your idea is good: create a function that hook ‘show_user_profile’ and ‘edit_user_profile’ action. In this function use a conditional to show a textarea only for admins and the content of this textarea (saved as user meta) to the owner of the profile. Something like (very rough and untested): function custom_profile_content ( $user ) … Read more
Get ID of the page where shortcode is included
welcome here… and to WordPress. To have a blog page, you have to set a page in your dashboard, in Settings -> Readings and select a page for stati Home Page a page for Blog Page. Here more info. In general, reading this page is a good read for a WP newbie. How blog index … Read more
For your first question “Detect where they are coming from”, Just check the $_SERVER[‘HTTP_REFERER’] for your expected web address. For the second “Create a short lived page”, your answer lies in the set_transient() method. You can do something like: function create_page() { if ( get_current_user_id() ) return “<html>…</html>”; return false; } function get_page( $unique_id ) … Read more
WordPress, page 2 shows the same posts as page 1
You can write your own query to include or exclude posts from an Author, This page has documentation about the options you can pass to a query. http://codex.wordpress.org/Class_Reference/WP_Query#Author_Parameters Here is an example to only get posts from the user $author. $author_query = new WP_Query(‘author_name=”.$author); for user “Amin’ : 🙂 $author_query = new WP_Query(‘author_name=Amin’);