Forum Replies Created

Viewing 15 replies - 391 through 405 (of 435 total)
  • Hello,

    I haven’t tried it but this plugin may be of use to you:
    https://www.ads-software.com/plugins/custom-post-type-permalinks/

    Forum: Fixing WordPress
    In reply to: Align these logos

    No worries, glad I could be of assistance!

    Forum: Fixing WordPress
    In reply to: Align these logos

    Take off the float:left and try this:

    img.sponsor-img {
        border: solid 1px blue;
        display: inline-block;
        vertical-align: middle;
    }

    No worries, glad I could help!

    Forum: Fixing WordPress
    In reply to: Align these logos

    Thanks.

    Looks like you need to change your display:block to display: inline-block as below:

    img.sponsor-img {
        display: inline-block;
    }

    There’s also this CSS rule overriding the above so delete this one or add an important to the display value above, otherwise it wont work.

    footer.mh-footer img {
        display: block;
    }

    You will need to define a new taxonomy and call it something other than ‘Category’ then as it’s looking at the built in WordPress categories.

    add_action( 'init', 'create_newcat_taxonomy' );
    
    function create_newcat_taxonomy() {
    	register_taxonomy(
    		'newcat',
    		'post',
    		array(
    			'label' => 'New category',
    			'hierarchical' => true,
    		)
    	);
    }

    Then in your taxonomy array add in:

    'taxonomies' => array('newcat'),

    Jetpack uses this to track visits to your site. It shouldn’t be anything to worry about.

    Where you have created your custom post type all you need to do is define categories as a taxonomy. Just add this into your custom post type function, it’s probably already in there with ‘tags’ in the array, just add ‘category’ instead.

    taxonomies' => array('category'),

    Getting the posts after a specific time can be achieved with 2 steps.

    You need to store the last login time of the user.
    Changing the query to pull the posts which are modified after the above login time.

    The below function will store the last login time of the user.

    // Associating a function to login hook
    add_action ( 'wp_login', 'set_last_login' );
    
    function set_last_login ( $login ) {
        $user = get_userdatabylogin ( $login );
    
        // Setting the last login of the user
        update_usermeta ( $user->ID, 'last_login', date ( 'Y-m-d H:i:s' ) );
    }

    Then you need to collect the last login time of the logged in user and modify the query as below. Currently it shows a list of posts but you should easily be able to modify this to output a number by counting the number of times it goes through the loop.

    <?php
    // Get current user object
    $current_user = wp_get_current_user();
    
    // Get the last login time of the user
    $last_login_time = get_user_meta ( $current_user->ID, 'last_login', true );
    
    // WP_Query with post modified time
    $the_query = new WP_Query(
                    array(
                        'date_query' =>
                            array(
                                'column' => 'post_modified',
                                'after' => $last_login_time,
                            )
                    )
                );
    ?>
    <?php if ( $the_query->have_posts() ) : ?>
    
        <?php // Start the Loop ?>
        <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
            <?php // Show the output ?>
        <?php endwhile; ?>
    
    <?php endif; ?>
    <?php
    // Restore original Post Data
    wp_reset_postdata();
    ?>
    Forum: Fixing WordPress
    In reply to: Align these logos

    Hello,

    It’s a bit difficult to actually see what the problem is as we can’t see the website but let’s see if I can help.

    The first thing is the sometimes the white space between the <img> tags in the widget can cause the images not to line up correctly, but it looks like you’ve done it fine from the picture.

    What CSS does the ‘sponsor-img’ class have applied to it? Are they float: left or display: inline-block; ?

    Thread Starter graphicscove

    (@graphicscove)

    Thanks for the update Marko! I’m looking forward to the release.

    Hello!

    It makes things easier for people looking at your question if you provide a link to your website, that way people can see what your problem is rather than guessing, leading to a quicker solution.

    Anyway as I can’t see your website this must be standard code which the theme puts out. I could offer a quick CSS solution if I knew the elements of your page. Better yet you could remove these from your themes template files. It usually varies from theme to theme but they can be removed from a file called ‘content.php’.

    Let us know your site URL and we might be able to help further.

    Forum: Fixing WordPress
    In reply to: Menu disappearing

    Hi Jim,

    To get a better understanding of your setup:
    What theme are you using?
    What is your website URL?

    I’ve not heard of this before, is this a clean install of WordPress?
    Have you tried applying this menu to locations other than ‘primary navigation’?

    Hello, what’s the URL of your site?

    graphicscove

    (@graphicscove)

    Hello 4RFM,

    Rule number 1, always disable the theme and plugin editors on live sites. Nothing good can come of using them.

    The only way to fix your issue is to find the file you have been editing through your hosting control panels file manager or via FTP. Correct the mistake you made then save the fixed file. There’s no other way to get the front facing website back without access to the php files.

    You must have done something else, the website is suffering from a code error. A ‘display none’ would still show items in the source but your site’s source is blank.

    If you can’t get your code to work then copy a backed up version of that file to your server. If you don’t have any backups copy it from one of the default WordPress themes.

    Let us know how you get on.

Viewing 15 replies - 391 through 405 (of 435 total)