Tag Info

Hot answers tagged

3

I was curious about this and checked the Codex on keyboard shortcuts, but didn't find it mentioned there. I searched and found out that this seems to be already solved, e.g. here and here. I haven't tested out these other plugins so I'm not sure how they solve it, but I decided to take on the challenge and see how this could be solved ;-) So here's my ...


2

Add following code in your theme's functions.php. // To add extra column in column headers add_filter('manage_posts_columns', 'bs_event_table_head'); function bs_event_table_head( $defaults ) { $defaults['pending_comments'] = 'Pending Comments'; return $defaults; } // To add data in column for each post. add_action( 'manage_posts_custom_column', ...


2

You can achive this using WP Query with meta_query argument as following. $args = array ( 'post_type' => array( 'post' ), // YOUR POST TYPE 'meta_query' => array( array( 'key' => 'country', 'value' => $your_country, // THE COUNTRY TO SEARCH 'compare' ...


2

There is almost never a scenario where executing PHP code entered from the wysiwyg editor is a good idea. It opens up a whole bunch of security issues. The best way to achieve what you are looking for is to setup a custom short code that will return the link you are interested in. Add something like this to your functions.php file in your theme. ...


1

As you can see, I tried declaring the $post variable as global to account for failures due to being outside of the Loop. The problem is not that the post is "outside of the loop", problem is that AJAX request is a completely separate HTTP request. When you do an AJAX request, is just like you are opening a new window on browser and open the url in ...


1

I have gone through your code and found that the function longform_the_related_posts displays 8 related posts. This function is defined in functions.php of parent theme and called in single.php. Thus, to override the function, follow below steps - 1. Create another function that displays 4 related posts in functions.php of child theme. (As you have ...


1

You could use this search and replace tool: search and replace by interconnectit Apart from that you could put some redirects in your htaccess, but really the search and replace works great.


1

I would suggest using nginx along with varnish. Varnish is a caching mechanism which runs on top of Apache/nginx. You can configure it to purge the cache after a specific time if you have users updating content often. In terms of server configuration, I would recommend Amazon Web Services' EC2. This will allow you to easily scale up as needed. I would not ...


1

Make sure your level ids are 1, 2, and 3, etc. //For check level id 1. if(pmpro_hasMembershipLevel(1, $user->ID)) You can check for get membership level of any user from documentation. PMPro includes a built-in function allowing you to require membership or require a specific membership level.


1

Just use the nextpage tag in the post (alt+shift+p shortcut in editor). <!--nextpage--> If the pagination doesn't show there anyway, you have to add wp_link_pages function to the single file template. wp_link_pages();


1

<?php query_posts('cat=24&posts_per_page=1'); ?> But using query_posts is a very bad idea. This is straigt from the Codex: For general post queries, use WP_Query or get_posts. It is strongly recommended that you use the pre_get_posts filter instead, and alter the main query by checking is_main_query.


1

This is the solution. I had the same problem with my Elegant Themes "Divi", but not other themes. I asked and in support forum the answer is in CSS: .stButton .stFb, .stButton .stTwbutton, .stButton .stMainServices { height: 28px !important; } Also, for the count bubble: .stHBubble { height: 22px !important; }


1

It's a UNIX timestamp - with PHP, you can use date to format it like so: echo date( 'd/m/Y', $timestamp ); // day/month/year



Only top voted, non community-wiki answers of a minimum length are eligible