How to Convert Shortcode into a link?

Wrap your shortcode in a div and give it an ID that you can use as a target when triggering your popup. For example, you can put the shortcode somewhere on your page (content, sidebar, etc) as follows: <div id=”popup” class=”lightbox”>[contact-form-7 id=”1735″ title=”Contact form 1″]</div> and the link that trigges the popup will look something … Read more

add custom menu in woocommerce dashboard [closed]

You can use the following to create a sub menu under woocommerce. Please use the following for reference. https://developer.wordpress.org/reference/functions/add_submenu_page/ add_action(‘admin_menu’, ‘testing_submenu_page’); function testing_submenu_page() { add_submenu_page( ‘woocommerce’, ‘sub menu’, ‘sub menu’, ‘manage_options’, ‘woo-subpage-test’, ‘test_callback’ ); } function test_callback() { echo ‘<div class=”wrap”><div id=”icon-tools” class=”icon32″></div>’; echo ‘<h2> Sub menu test page</h2>’; echo ‘</div>’; } Example what the … Read more

Set maximum number of letters limit on xprofile fields [closed]

Try this code, if it will helps: function filtered_profile_data( $args ) { $data = bp_get_member_profile_data( $args ); $defaults = array( ‘field’ => false, // Field name ‘user_id’ => $user_id ); $r = wp_parse_args( $args, $defaults ); extract( $r, EXTR_SKIP ); switch($field) { case ‘Field Name’: // for specific field character limit $max_len = 10; break; … Read more

link to page_for_posts

I wouldn’t classify this as a WordPress issue persay. The problem is that any get_*() functions return values. This means that get_permalink() returns the permalink to be assigned ot a variable which you’re not doing or intend to do in this case. So we have the value sitting in memory all we need to do … Read more

Why wordpress can’t display the bash command properly?

When a post gets published, it runs the_content() through a filter to strip out unsafe HTML. It looks like the parser thinks <people.txt is malformed HTML and strips it out. Change < to &lt;, which is the HTML entity for <, and you should be able to publish the post and view it properly on … Read more

How to generate external url in WordPress

@Sam is close, but I think you need to do this: $url=”http://www.example.com”; Without the protocol in front, you get the wrong result. Change to $url=”https://www.example.com”; if you need an SSL link.

How to display recent posts on home page with title, post date, author and featured image?

The functions you are looking for, are: the_post_thumbnail_url(); // For featured image the_author(); // For author name get_author_posts_url(); // For author link the_date(); // For post’s date So, your code should be something like this: <div class=”cs-post-carousel-layout”> <div class=”cs-container swiper-container”> <div class=”swiper-wrapper”><?php // define query arguments $args = array( ‘posts_per_page’ => 5, // your ‘x’ … Read more