Display function from functions.php in tag.php
Thank you @bueltge for the answer! I was focusing on the shortcode and didn’t even think to call the function in the ‘normal’ way. echo dynamicContent() worked.
Thank you @bueltge for the answer! I was focusing on the shortcode and didn’t even think to call the function in the ‘normal’ way. echo dynamicContent() worked.
If you have a max-width on your element you could get around this with CSS like text-overflow: ellipsis; white-space: nowrap;
CloudFlare was caching my CSS files. I diagnosed this by selectively purging the CSS file from the cache, and then solved the issue by turning on “Development Mode”, all via the CloudFlare dashboard.
Since you’re using the same key for all the values you can simply use: update_post_meta($this->current_post_id, ‘assigned-sales’, $response->records); This will store the whole array in a single meta entry with key of ‘assigned-sales’. WordPress will update the value if it exists and create new one otherwise, no need to have logic for that. In case you … Read more
If you want to append HTML to images, you want to look inside the template files. Search for something like the_post_thumbnail function, and add your HTML right after the closing </a> tag (if there is one). You’d then need to style it with CSS so that it’s only visible upon hovering the image. For example, … Read more
is_preview() should return true is it is a preview. Did you try the following on the page.php? if(is_preview()){ echo “preview” }else{ echo “no preview” } to check if the is_preview() function is working? EDIT2: You could work your way around it and check for: if($_GET[‘preview’] == true){}
I have no way to test this, but the structure looks like so. function pushMauticForm( $vendorId, $userId, $data, $formId, $ip = null ) { //get array of form data; //example: match mautic label (left) with form label ($_REQUEST[‘vendor-owner-firstname’] // parse the request args and merge with our defaults // this ensures we don’t have to … Read more
Use get_the_title() since you’re already being passed a post ID. function rename_attacment( $post_ID ) { $post = get_post( $post_ID ); $file = get_attached_file( $post_ID ); $path = pathinfo( $file ); //dirname = File Path //basename = Filename.Extension //extension = Extension //filename = Filename $newfilename = get_the_title( $post_ID ); $newfile = $path[‘dirname’] . “https://wordpress.stackexchange.com/” . $newfilename … Read more
Finally I found the solution in codex…. Interpreting the Error Message: If the error message states: Warning: Cannot modify header information – headers already sent by (output started at /path/blog/wp-config.php:34) in /path/blog/wp-login.php on line 42, then the problem is at line #34 of wp-config.php, not line #42 of wp-login.php. In this scenario, line #42 of … Read more
Are you sure you want to do this in this manner? Normally a section like this might be written to the page template somehow and not called via the content editor. That being said, this should do what you need: add_shortcode( ‘show_xyz_news’, ‘xyz_news_query’ ); function xyz_news_query() { $args = array( ‘posts_per_page’ => 3, ‘category_name’ => … Read more