Articles of php

Parse error syntax error unexpected t_string

I’m getting the following error: PHP Syntax Check: Parse error: syntax error, unexpected ‘qtip’ (T_STRING), expecting ‘)’ in your code on line 14 in this code: <?php // Always use wp_enqueue_scripts action hook to both enqueue and register scripts add_action( ‘wp_enqueue_scripts’, ‘enqueue_and_register_qtip_scripts_and_style’ ); function enqueue_and_register_qtip_scripts_and_style(){ // Use `get_stylesheet_directoy_uri() if your script is inside your theme […]

Remove Post if Advanced Custom Field is checked to fix paging

I’m trying to setup a query that filters through posts and removes ones that have an ACF field “archived” checked. Post queries are pretty foreign to me. query_posts(“cat=10&posts_per_page=12&post_status=any&order=ASC”.”&paged=”.$paged); How can I edit that string to check to see if the post has the archived checkbox checked? This is how I’m currently doing it, but because […]

implementing a jQuery “click to expand” link in WordPress

Novice coder – apologies for any stupid comments I’ve been trying to make a show more button on one of the div s on my WordPress blog page. I’ve looked at a number of tutorials that all seem to agree that JavaScript / jQuery is the only way to do it. Many solutions rely on […]

Unable to Call More than One Meta Box Output

I have a custom meta box with multiple text fields. I use this to call the information in the first box: <?php the_post(); echo get_post_meta( get_the_ID(), ‘dbt_text’, true ); ?> And this to call the second field: <?php the_post(); echo get_post_meta( get_the_ID(), ‘dbt_text1′, true ); ?> Here’s the problem, when used individually they work perfectly. […]

Replace Post-Title with variable

I want to set a custom post-title with a custom-field meta in my WordPress Theme. The user will add a new post to the post-type. When they do they will only see the “Title”, “URL”, and “Publish” metas. I want to eliminate the “Title” and only show the “URL” and “Publish” meta. When the user […]

Create Div Wrapper On 3rd Iteration Or When Query Loop Items Run Out

I’m running into an issue.. I’ve written a code inside a loop so that it creates a new box every 3rd iteration in the loop. It does this nicely, however for example if I have 4 items in a full query of returned posts , it breaks on the 4th one because when it resets […]

Cannot modify header information – server cache

I have a wordpress website hosted on Lightspeed server. There’s an error message displaying in admin login page and I can’t access wordpress backend. This is the error Warning: Cannot modify header information – headers already sent by (output started at /tmp/session_f54bfef1a94d74c2534c8668c57bb987:33) in /home/website/public_html/wp-includes/pluggable.php on line 1173 What I see is that there’s some kind […]

How to Make Thumbnail of Post Stay Animated

When I upload my post with an animated .gif, the thumbnail generates into a new image and doesn’t stay animated. It will stay animated inside the post which is great. It seems to resize the .gif image and convert it into a static image because it generates an image with the sizing at the end […]

Adding data to custom wordpress database table

I have a form on a page that populates the database table: <table border=”1″> <tr> <td align=”center”>Form Input Employees Data</td> </tr> <tr> <td> <table> <form method=”post” action=”input.php”> <tr> <td>Product Name</td> <td><input type=”text” name=”name” size=”20″> </td> </tr> <tr> <td>Brand</td> <td><input type=”text” name=”brand” size=”40″> </td> </tr> <tr> <td></td> <td align=”right”><input type=”submit” name=”submit” value=”Sent”></td> </tr> </table> </td> </tr> […]

Check in which custom taxonomy belongs and change the style

I want to change the css style of a single.php which belongs to a custom taxonomy, based on the category. I achieved to do it in taxonomy.php for some of the categories but i can’t make it to work on a single.php. For the taxonomy.php i used is_tax and worked ok. For single.php i used […]